Module: RicherText::TagHelper
- Defined in:
- lib/richer_text/tag_helper.rb,
app/helpers/richer_text/tag_helper.rb
Instance Method Summary collapse
- #rhino_text_area_tag(name, value = nil, options = {}) ⇒ Object
- #richer_text_area_tag(name, value = nil, options = {}) ⇒ Object
Instance Method Details
#rhino_text_area_tag(name, value = nil, options = {}) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'app/helpers/richer_text/tag_helper.rb', line 77 def rhino_text_area_tag(name, value = nil, = {}) = .symbolize_keys [:input] ||= "rhino_text_input_#{RicherText::TagHelper.id += 1}" # So we can choose the serializer to use, e.g. "html" or "json" [:serializer] ||= "html" input_tag = hidden_field_tag(name, value, id: [:input]) editor_tag = tag("rhino-editor", { input: [:input], serializer: "json", data: { "blob-url-template": rails_service_blob_url(":signed_id", ":filename"), "direct-upload-url": rails_direct_uploads_url }}.merge()) input_tag + editor_tag end |
#richer_text_area_tag(name, value = nil, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/helpers/richer_text/tag_helper.rb', line 61 def richer_text_area_tag(name, value = nil, = {}) = RicherText..merge(.symbolize_keys).symbolize_keys [:input] ||= "richer_text_input_#{RicherText::TagHelper.id += 1}" # So that we can access the content in the tiptap editor [:content] ||= value # So we can choose the serializer to use, e.g. "html" or "json" [:serializer] ||= "html" input_tag = hidden_field_tag(name, value, id: [:input]) editor_tag = tag("richer-text-editor", ) input_tag + editor_tag end |