Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use safe_join in number helper

  • Loading branch information...
commit 0f848dd54911f0e15c5c3aceabf09582cc6eab16 1 parent 14d1e55
@lest lest authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_view/helpers/number_helper.rb
View
2  actionpack/lib/action_view/helpers/number_helper.rb
@@ -233,7 +233,7 @@ def number_with_delimiter(number, options = {})
parts = number.to_s.to_str.split('.')
parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{options[:delimiter]}")
- parts.join(options[:separator]).html_safe
+ safe_join(parts, options[:separator])
end
# Formats a +number+ with the specified level of <tt>:precision</tt> (e.g., 112.32 has a precision

3 comments on commit 0f848dd

@josevalim
Owner

safe_join is required when you need to safely join the intermediate parts, in this case, all the parts are valid and therefore the previous code was valid and likely faster.

@lest

@josevalim should we revert it?

@josevalim
Owner
Please sign in to comment.
Something went wrong with that request. Please try again.