aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorTom Lea <contrib@tomlea.co.uk>2008-08-26 11:08:31 +0100
committerMichael Koziarski <michael@koziarski.com>2008-08-29 20:52:01 +0200
commitdb26b47b9f4dbebd478a5fe6c0dcd38b8697939a (patch)
tree7312c03896fef70832bb116c0f644bbb222b3c9e /actionpack/lib
parentd0b949d87375ae351757adffd192d8cb1f3dbf8d (diff)
downloadrails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.tar.gz
rails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.tar.bz2
rails-db26b47b9f4dbebd478a5fe6c0dcd38b8697939a.zip
Ensure that calling content_tag_for in a helper doesn't cause duplicate output.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#871 state:committed]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/record_tag_helper.rb6
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 9bb235175e..0cdb70e217 100644
--- a/actionpack/lib/action_view/helpers/record_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb
@@ -49,9 +49,9 @@ module ActionView
#
def content_tag_for(tag_name, record, *args, &block)
prefix = args.first.is_a?(Hash) ? nil : args.shift
- options = args.first.is_a?(Hash) ? args.shift : {}
- concat content_tag(tag_name, capture(&block),
- options.merge({ :class => "#{dom_class(record)} #{options[:class]}".strip, :id => dom_id(record, prefix) }))
+ options = args.extract_options!
+ options.merge!({ :class => "#{dom_class(record)} #{options[:class]}".strip, :id => dom_id(record, prefix) })
+ content_tag(tag_name, options, &block)
end
end
end