aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-02 04:05:05 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-02 09:17:54 -0300
commit7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4 (patch)
tree4fd17d972486f65475cbb6ca7434d9b816426f74 /actionpack/lib/action_view/helpers
parent51ab77e9ba3af15f24457e8c64314d0c9a6105ea (diff)
downloadrails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.tar.gz
rails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.tar.bz2
rails-7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4.zip
Make content_tag_for work without block
This is version of #8640 for master
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/record_tag_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb
index 33194250b7..6d99d43fb8 100644
--- a/actionpack/lib/action_view/helpers/record_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb
@@ -95,7 +95,11 @@ module ActionView
options[:class] = "#{dom_class(record, prefix)} #{options[:class]}".rstrip
options[:id] = dom_id(record, prefix)
- content_tag(tag_name, capture(record, &block), options)
+ if block_given?
+ content_tag(tag_name, capture(record, &block), options)
+ else
+ content_tag(tag_name, "", options)
+ end
end
end
end