From 8c105ee0c888a63cdbf593f0bfe688065b3e09e2 Mon Sep 17 00:00:00 2001 From: Andrew Kaspick Date: Thu, 25 Sep 2008 21:44:34 -0500 Subject: Add options to field_set_tag Signed-off-by: Michael Koziarski [#1116 state:committed] --- actionpack/lib/action_view/helpers/form_tag_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 294c22521e..208bf91dd4 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -403,6 +403,7 @@ module ActionView # Creates a field set for grouping HTML form elements. # # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. # # === Examples # <% field_set_tag do %> @@ -414,9 +415,14 @@ module ActionView #

<%= text_field_tag 'name' %>

# <% end %> # # =>
Your details

- def field_set_tag(legend = nil, &block) + # + # <% field_set_tag nil, :class => 'format' do %> + #

<%= text_field_tag 'name' %>

+ # <% end %> + # # =>

+ def field_set_tag(legend = nil, options = nil, &block) content = capture(&block) - concat(tag(:fieldset, {}, true)) + concat(tag(:fieldset, options, true)) concat(content_tag(:legend, legend)) unless legend.blank? concat(content) concat("") -- cgit v1.2.3