Need help with @template.content_tag

Hi all

I have my own FormBuilder. One of its functionalities is to group fields
using the following method:

  def group_fields(legend, options = {}, &block)
    concat(@template.content_tag('fieldset',
      @template.content_tag('legend',
        legend
      ) + capture(&block), options),
    block.binding)
  end

This just creates a fieldset tag and puts the fields into it:

form.group_fields('Caption...') do |group|
  group.text_area(:asdf)
end

Now I need to modify it a little bit for design purposes: I need another
div around the fields! But I just seem to be unable to modify it the way
it should be modified! I always get compile errors and stuff. :wink:

Maybe a more experienced coder can help me?

Thanks a lot
Josh

Hi all

I have my own FormBuilder. One of its functionalities is to group fields
using the following method:

def group_fields(legend, options = {}, &block)
   concat(

@template.content_tag('div',

@template.content_tag('fieldset',
     @template.content_tag('legend',
       legend
     ) + capture(&block)

, :any => 'stuff', :for => 'the div')

, options),
   block.binding)
end

Does that do what you want? (after you put the lines that start with commas back together with the previous line, of course)

-Rob

Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com