field_set_tag should take an options hash
Reported by 2 College Bums | July 8th, 2008 @ 09:11 PM | in 2.x
currently field_set_tag only takes a legend and a block, and forces an empty hash for the options in the fieldset tag call.
module ActionView
module Helpers
module FormTagHelper
def field_set_tag(legend = nil, options={}, &block)
content = capture(&block)
concat(tag(:fieldset, options, true), block.binding)
concat(content, block.binding)
concat("</fieldset>", block.binding)
end
Comments and changes to this ticket
-

Donald July 9th, 2008 @ 09:49 AM
Shouldn't that be:
module ActionView
module Helpers
module FormTagHelper
def field_set_tag(legend = nil, options={}, &block)
content = capture(&block)
concat(tag(:fieldset, options, true), block.binding)
concat(content_tag(:legend, legend), block.binding) unless legend.blank?
concat(content, block.binding)
concat("", block.binding)
end
end
end
end
-

2 College Bums July 9th, 2008 @ 10:31 PM
Good catch. However you need a closing fieldset tag
def field_set_tag(legend = nil, options={}, &block) content = capture(&block) concat(tag(:fieldset, options, true), block.binding) concat(content_tag(:legend, legend), block.binding) unless legend.blank? concat(content, block.binding) concat("</fieldset>", block.binding) end -
Joshua Peek October 12th, 2008 @ 08:11 PM
- → State changed from new to wontfix
-

2 College Bums October 16th, 2008 @ 07:43 AM
- → Assigned user changed from to Joshua Peek
Hey Joshua,
Thanks for reviewing our ticket. May we ask the rationale for not allowing an options hash for the fieldset tag?
Thanks!
-

Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
The Git repository resides at http://github.com/rails
Check out the current development trunk (Edge Rails) with:
git clone git://github.com/rails/rails.git
Creating or reviewing a patch
See the contributor guide.
Creating a feature request
Please don't. If you want a new feature in Rails, you'll have to pull up your sleeves and get busy yourself. Or convince someone else to do it. See the contributor guide on how to get going. But posting them here is just going to lead to ticket root.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too".
