diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-21 10:36:37 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-25 10:51:00 -0200 |
commit | c753e3af764f4888bc71720741158863b23d63c1 (patch) | |
tree | b1073c9d2a9aeb50c9c5304581459f03a920f75d | |
parent | 1e78fed488d136041f44a452012a71bb1a348c2f (diff) | |
download | rails-c753e3af764f4888bc71720741158863b23d63c1.tar.gz rails-c753e3af764f4888bc71720741158863b23d63c1.tar.bz2 rails-c753e3af764f4888bc71720741158863b23d63c1.zip |
Refactor percentage helper
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 2fab23e777..9808178800 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -196,7 +196,8 @@ module ActionView if options[:raise] raise else - e.number.to_s.html_safe? ? format.gsub(/%n/, e.number).html_safe : format.gsub(/%n/, e.number) + formatted_number = format.gsub(/%n/, e.number) + e.number.to_s.html_safe? ? formatted_number.html_safe : formatted_number end end end |