diff options
author | wycats <wycats@gmail.com> | 2010-08-31 19:52:26 +0900 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-08-31 19:52:26 +0900 |
commit | c05f24c824ce9ee855f4c42c95eafb2e8640d08d (patch) | |
tree | ce7cf7e71a21ef97d153e021886ec6b88dd323a5 /actionpack/lib/action_view | |
parent | 3805d01c9b0ee6681d3e36233a82731200b87d34 (diff) | |
download | rails-c05f24c824ce9ee855f4c42c95eafb2e8640d08d.tar.gz rails-c05f24c824ce9ee855f4c42c95eafb2e8640d08d.tar.bz2 rails-c05f24c824ce9ee855f4c42c95eafb2e8640d08d.zip |
Speed up content_tag_for by simplifying needed logic
Diffstat (limited to 'actionpack/lib/action_view')
-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 e4a9210cde..4d300a1469 100644 --- a/actionpack/lib/action_view/helpers/record_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb @@ -52,9 +52,9 @@ module ActionView # # <li id="person_123" class="person bar">... # - def content_tag_for(tag_name, record, *args, &block) - prefix = args.first.is_a?(Hash) ? nil : args.shift - options = args.extract_options! + def content_tag_for(tag_name, record, prefix = nil, options = nil, &block) + options, prefix = prefix, nil if prefix.is_a?(Hash) + options ||= {} options.merge!({ :class => "#{dom_class(record, prefix)} #{options[:class]}".strip, :id => dom_id(record, prefix) }) content_tag(tag_name, options, &block) end |