Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

field_set_tag should take an options hash

#577

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

Reported by 2 College Bums · July 8th, 2008 @ 09:11 PM

State: wontfix
Milestone: 2.x
Assigned to: josh josh
Importance: none

Activity

  1. Donald Piret
    Donald Piret

    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

    July 9th, 2008 @ 09:49 AM

  2. 2 College Bums
    2 College Bums

    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
    

    July 9th, 2008 @ 10:31 PM

  3. josh
    josh
    • State changed from new to wontfix

    October 12th, 2008 @ 08:11 PM

  4. 2 College Bums
    2 College Bums
    • 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!

    October 16th, 2008 @ 07:43 AM

  5. Tom Stuart