aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-04-26 11:41:25 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-04-26 11:41:25 -0700
commit8b0489cc9a28fa5d22e6c92df7e2294b4800048a (patch)
tree35b2ff6b9c819c850b982e8b91988713bfe8ec50
parent14d1e554d93619c5d57c5921d308a05257198393 (diff)
parent10f90bd24137cf9338b9aa72555bf67c69e4737e (diff)
downloadrails-8b0489cc9a28fa5d22e6c92df7e2294b4800048a.tar.gz
rails-8b0489cc9a28fa5d22e6c92df7e2294b4800048a.tar.bz2
rails-8b0489cc9a28fa5d22e6c92df7e2294b4800048a.zip
Merge pull request #6002 from lest/patch-1
Tiny refactoring in NumberHelper and RecordTagHelper
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/record_tag_helper.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb
index d44e6d0496..2011351bd2 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -233,7 +233,7 @@ module ActionView
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
diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb
index 1a15459406..9b35f076e5 100644
--- a/actionpack/lib/action_view/helpers/record_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb
@@ -94,10 +94,10 @@ module ActionView
# for each record.
def content_tag_for_single_record(tag_name, record, prefix, options, &block)
options = options ? options.dup : {}
- options.merge!(:class => "#{dom_class(record, prefix)} #{options[:class]}".rstrip, :id => dom_id(record, prefix))
+ options[:class] = "#{dom_class(record, prefix)} #{options[:class]}".rstrip
+ options[:id] = dom_id(record, prefix)
- content = block.arity == 0 ? capture(&block) : capture(record, &block)
- content_tag(tag_name, content, options)
+ content_tag(tag_name, capture(record, &block), options)
end
end
end