diff options
author | Javan Makhmali <javan@javan.us> | 2018-10-06 12:15:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-06 12:15:26 -0400 |
commit | ddcfefaa6f0cd4e3a6ab5cc2a7a927160bf37ae6 (patch) | |
tree | e50412fd95d23489c9b33dc2fbb64a854d134d48 | |
parent | 5a8e37f71549d839f97ef71b29f996c563af2289 (diff) | |
parent | 2e9f3b5b0dcd217fb63c060da2f2110422319ee3 (diff) | |
download | rails-ddcfefaa6f0cd4e3a6ab5cc2a7a927160bf37ae6.tar.gz rails-ddcfefaa6f0cd4e3a6ab5cc2a7a927160bf37ae6.tar.bz2 rails-ddcfefaa6f0cd4e3a6ab5cc2a7a927160bf37ae6.zip |
Merge pull request #17 from huacnlee/fix/uninitialized-constant-on-rails-reload
Fix `uninitialized constant ActionText:: ALLOWED_TAGS` error on Rails reload
-rw-r--r-- | app/helpers/action_text/content_helper.rb | 10 |
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 |