richer_text 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/richer_text/tag_helper.rb +1 -0
- data/lib/richer_text/attribute.rb +5 -1
- data/lib/richer_text/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678e1169424b3442c3a1930a2ab34e4e7ec724e2a2e8381bfdd7f8b789bb1eff
|
4
|
+
data.tar.gz: 5dfd1574889342d9308fbbe79c5959bdc86eb816ae8d82f466ed6140f8ab3dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59ca2d890918fb81e3d4ee4619c2ce1c5e41ea97736f90cf0bec50ab2eb10a2e007cdd2a466e5bdfe8ad0bb522252fa00165984bc8fcc729489eededf47c884d
|
7
|
+
data.tar.gz: 7fcb45cebc874bbe5437a695688677d6d4eb90493e18021b46e776453c105722946e14aa0845f33bd050bf1cfed64ca67063dd381044924d0c4b71b6d8552306
|
@@ -12,6 +12,7 @@ module ActionView::Helpers
|
|
12
12
|
options["input"] ||= dom_id(object, [options["id"], :richer_text_input].compact.join("_")) if object
|
13
13
|
options["value"] = options.fetch("value") { value&.to_editor_format }
|
14
14
|
options["serializer"] = options.fetch("serializer") { object.class.send(:"richer_text_#{@method_name}_json") ? "json" : "html" }
|
15
|
+
options["attachments"] = options.fetch("attachments") { object.class.send(:"richer_text_#{@method_name}_allow_attachments") }
|
15
16
|
|
16
17
|
@template_object.richer_text_area_tag(options.delete("name"), options["value"], options.except("value"))
|
17
18
|
end
|
@@ -3,11 +3,15 @@ module RicherText
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
class_methods do
|
6
|
-
def has_richer_text(name, store_as: :html)
|
6
|
+
def has_richer_text(name, store_as: :html, attachments: true)
|
7
7
|
# Store if the attribute is using JSON or not.
|
8
8
|
class_attribute :"richer_text_#{name}_json", instance_writer: false
|
9
9
|
self.send(:"richer_text_#{name}_json=", store_as == :json)
|
10
10
|
|
11
|
+
# Store if the attribute allows attachments
|
12
|
+
class_attribute :"richer_text_#{name}_allow_attachments", instance_writer: false
|
13
|
+
self.send(:"richer_text_#{name}_allow_attachments=", attachments)
|
14
|
+
|
11
15
|
class_eval <<-CODE, __FILE__, __LINE__ + 1
|
12
16
|
def #{name}
|
13
17
|
richer_text_#{name} || build_richer_text_#{name}
|
data/lib/richer_text/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: richer_text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Fomera
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|