Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need to check html_safe? twice

  • Loading branch information...
commit 01b4a7c1f4943e9600062de041a4c59c7b0e2ab1 1 parent a2d0b99
@rafaelfranca rafaelfranca authored
View
2  actionpack/CHANGELOG.md
@@ -1,5 +1,7 @@
## Rails 4.0.0 (unreleased) ##
+* Add `:format` option to number_to_percentage *Rodrigo Flores*
+
* Add `config.action_view.logger` to configure logger for ActionView. *Rafael França*
* Deprecated ActionController::Integration in favour of ActionDispatch::Integration
View
3  actionpack/lib/action_view/helpers/number_helper.rb
@@ -205,8 +205,7 @@ def number_to_percentage(number, options = {})
if options[:raise]
raise
else
- formatted_number = e.number.to_s.html_safe? ? format.gsub(/%n/, e.number).html_safe : format.gsub(/%n/, e.number)
- formatted_number.html_safe? ? formatted_number.html_safe : formatted_number
+ e.number.to_s.html_safe? ? format.gsub(/%n/, e.number).html_safe : format.gsub(/%n/, e.number)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.