This project is archived and is in readonly mode.

#577 ✓wontfix
2 College Bums

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 Piret

    Donald Piret 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

    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
    
  • josh

    josh October 12th, 2008 @ 08:11 PM

    • State changed from “new” to “wontfix”
  • 2 College Bums

    2 College Bums October 16th, 2008 @ 07:43 AM

    • Assigned user set to “josh”

    Hey Joshua,

    Thanks for reviewing our ticket. May we ask the rationale for not allowing an options hash for the fieldset tag?

    Thanks!

  • Tom Stuart

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages