diff options
author | Bodacious <gavin@katanacode.com> | 2012-05-17 18:15:43 +0100 |
---|---|---|
committer | Bodacious <gavin@katanacode.com> | 2012-05-17 18:15:43 +0100 |
commit | 56aabfd559459da6fb8e736ee5c21a139870cd5a (patch) | |
tree | 866f65fb54ce3207640139c1d48736bcb75dc50d /actionpack/lib/action_view | |
parent | 6ada771a08196d8a5d790f8b4b2224aa8e1748b3 (diff) | |
download | rails-56aabfd559459da6fb8e736ee5c21a139870cd5a.tar.gz rails-56aabfd559459da6fb8e736ee5c21a139870cd5a.tar.bz2 rails-56aabfd559459da6fb8e736ee5c21a139870cd5a.zip |
Fixed tag_helper data-attribute bug with BigDecimals
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index d5cd60e8a1..498be596ad 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -154,8 +154,9 @@ module ActionView def data_tag_option(key, value, escape) key = "data-#{key.to_s.dasherize}" - value = value.to_json if !value.is_a?(String) && !value.is_a?(Symbol) - + unless value.is_a?(String) || value.is_a?(Symbol) || value.is_a?(BigDecimal) + value = value.to_json + end tag_option(key, value, escape) end |