aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/action_text/tag_helper.rb
diff options
context:
space:
mode:
authorAlberto Almagro Sotelo <albertoalmagro@gmail.com>2018-10-09 23:10:07 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-10-09 14:10:07 -0700
commit9febb318043e5320d7338f0267c6aef651cd9315 (patch)
tree883f0f625d689e56e6c78bb46d127bc1e59f452d /app/helpers/action_text/tag_helper.rb
parentdc63aa42b075969359699c4076ad233d66d49eec (diff)
downloadrails-9febb318043e5320d7338f0267c6aef651cd9315.tar.gz
rails-9febb318043e5320d7338f0267c6aef651cd9315.tar.bz2
rails-9febb318043e5320d7338f0267c6aef651cd9315.zip
Prevent rich_text_area from raising when inexistent attribute is passed (#24)
When an inexistent attribute is passed as a parameter to currently existing Rails' Form Helpers they render an empty tag instead of raising an exception. This commit confers the same behavior to `rich_text_area`. Fixes #19
Diffstat (limited to 'app/helpers/action_text/tag_helper.rb')
-rw-r--r--app/helpers/action_text/tag_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/action_text/tag_helper.rb b/app/helpers/action_text/tag_helper.rb
index 103b65eb97..c7ba416880 100644
--- a/app/helpers/action_text/tag_helper.rb
+++ b/app/helpers/action_text/tag_helper.rb
@@ -45,7 +45,7 @@ module ActionView::Helpers
end
def editable_value
- value.body.try(:to_trix_html)
+ value&.body.try(:to_trix_html)
end
end