diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-04-26 21:24:38 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-04-26 21:25:42 +0300 |
commit | 10f90bd24137cf9338b9aa72555bf67c69e4737e (patch) | |
tree | 35b2ff6b9c819c850b982e8b91988713bfe8ec50 | |
parent | 0f848dd54911f0e15c5c3aceabf09582cc6eab16 (diff) | |
download | rails-10f90bd24137cf9338b9aa72555bf67c69e4737e.tar.gz rails-10f90bd24137cf9338b9aa72555bf67c69e4737e.tar.bz2 rails-10f90bd24137cf9338b9aa72555bf67c69e4737e.zip |
refactor content_tag_for helper
- do not use merge! just for 2 values
- there is no need to check block arity
-rw-r--r-- | actionpack/lib/action_view/helpers/record_tag_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |