aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_tag_helper.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-02 02:30:47 -0800
committerPiotr Sarnacki <drogus@gmail.com>2012-03-02 02:30:47 -0800
commit9078dba7de7e703f1558b03502791b16225d18eb (patch)
tree0f5e2ccfd12425671ea56259548b51d3af2f4ad8 /actionpack/lib/action_view/helpers/form_tag_helper.rb
parentfcef72890b7f8b974ee490268a48e147bd621253 (diff)
parent81d3493c172dc717a86e81a855f4983a3774b846 (diff)
downloadrails-9078dba7de7e703f1558b03502791b16225d18eb.tar.gz
rails-9078dba7de7e703f1558b03502791b16225d18eb.tar.bz2
rails-9078dba7de7e703f1558b03502791b16225d18eb.zip
Merge pull request #5234 from benpickles/allow-empty-fieldsets
Allow empty fieldsets to be created without a block.
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index 2cf1c9055c..9fad30a48f 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -525,10 +525,9 @@ module ActionView
# <% end %>
# # => <fieldset class="format"><p><input id="name" name="name" type="text" /></p></fieldset>
def field_set_tag(legend = nil, options = nil, &block)
- content = capture(&block)
output = tag(:fieldset, options, true)
output.safe_concat(content_tag(:legend, legend)) unless legend.blank?
- output.concat(content)
+ output.concat(capture(&block)) if block_given?
output.safe_concat("</fieldset>")
end