Skip to content

Commit

Permalink
Merge pull request #5792 from lest/patch-4
Browse files Browse the repository at this point in the history
no need in temporary array in number_to_phone helper
  • Loading branch information
fxn committed Apr 11, 2012
2 parents b79b784 + 332c3e1 commit 6da5002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/number_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def number_to_phone(number, options = {})
number.slice!(0, 1) if number.start_with?(delimiter) && !delimiter.blank? number.slice!(0, 1) if number.start_with?(delimiter) && !delimiter.blank?
end end


str = [] str = ''
str << "+#{country_code}#{delimiter}" unless country_code.blank? str << "+#{country_code}#{delimiter}" unless country_code.blank?
str << number str << number
str << " x #{extension}" unless extension.blank? str << " x #{extension}" unless extension.blank?
ERB::Util.html_escape(str.join) ERB::Util.html_escape(str)
end end


# Formats a +number+ into a currency string (e.g., $13.65). You can customize the format # Formats a +number+ into a currency string (e.g., $13.65). You can customize the format
Expand Down

0 comments on commit 6da5002

Please sign in to comment.