1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #6002 from lest/patch-1

Tiny refactoring in NumberHelper and RecordTagHelper
This commit is contained in:
Jeremy Kemper 2012-04-26 11:41:25 -07:00
commit 8b0489cc9a
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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