aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/action_text/content_helper.rb
diff options
context:
space:
mode:
authorJason Lee <huacnlee@gmail.com>2018-10-06 22:27:54 +0800
committerJason Lee <huacnlee@gmail.com>2018-10-06 22:27:54 +0800
commit2e9f3b5b0dcd217fb63c060da2f2110422319ee3 (patch)
tree934d71b3ef47e7ec2bcc9f7e09b503f735525ac7 /app/helpers/action_text/content_helper.rb
parent33f940f1407870f451e19c479f816edaf9ab0c1e (diff)
downloadrails-2e9f3b5b0dcd217fb63c060da2f2110422319ee3.tar.gz
rails-2e9f3b5b0dcd217fb63c060da2f2110422319ee3.tar.bz2
rails-2e9f3b5b0dcd217fb63c060da2f2110422319ee3.zip
Fix `uninitialized constant ActionText:: ALLOWED_TAGS` error on Rails reloading
Diffstat (limited to 'app/helpers/action_text/content_helper.rb')
-rw-r--r--app/helpers/action_text/content_helper.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/action_text/content_helper.rb b/app/helpers/action_text/content_helper.rb
index aa2aeba44b..99255494b1 100644
--- a/app/helpers/action_text/content_helper.rb
+++ b/app/helpers/action_text/content_helper.rb
@@ -1,9 +1,9 @@
module ActionText
- SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer
- ALLOWED_TAGS = SANITIZER.allowed_tags + [ ActionText::Attachment::TAG_NAME, "figure", "figcaption" ]
- ALLOWED_ATTRIBUTES = SANITIZER.allowed_attributes + ActionText::Attachment::ATTRIBUTES
-
module ContentHelper
+ SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer
+ ALLOWED_TAGS = SANITIZER.allowed_tags + [ ActionText::Attachment::TAG_NAME, "figure", "figcaption" ]
+ ALLOWED_ATTRIBUTES = SANITIZER.allowed_attributes + ActionText::Attachment::ATTRIBUTES
+
def render_action_text_content(content)
content = content.render_attachments do |attachment|
unless attachment.in?(content.gallery_attachments)
@@ -22,7 +22,7 @@ module ActionText
end.chomp
end
- sanitize content.to_html, tags: ActionText::ALLOWED_TAGS, attributes: ActionText::ALLOWED_ATTRIBUTES
+ sanitize content.to_html, tags: ALLOWED_TAGS, attributes: ALLOWED_ATTRIBUTES
end
end
end