Module: ActionText::ContentHelper
- Defined in:
- app/helpers/action_text/content_helper.rb
Instance Method Summary collapse
- #render_action_text_attachments(content) ⇒ Object
- #render_action_text_content(content) ⇒ Object
- #sanitize_action_text_content(content) ⇒ Object
Instance Method Details
#render_action_text_attachments(content) ⇒ Object
[View source]
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/action_text/content_helper.rb', line 20 def (content) content. do || unless .in?(content.) .node.tap do |node| node.inner_html = render(, in_gallery: false).chomp end end end. do || render(layout: , object: ) do ..map do || .node.inner_html = render(, in_gallery: true).chomp .to_html end.join("").html_safe end.chomp end end |
#render_action_text_content(content) ⇒ Object
[View source]
12 13 14 |
# File 'app/helpers/action_text/content_helper.rb', line 12 def render_action_text_content(content) sanitize_action_text_content((content)) end |
#sanitize_action_text_content(content) ⇒ Object
[View source]
16 17 18 |
# File 'app/helpers/action_text/content_helper.rb', line 16 def sanitize_action_text_content(content) sanitizer.sanitize(content.to_html, tags: , attributes: allowed_attributes, scrubber: scrubber).html_safe end |