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

On Mar 25, 2008, at 9:49 AM, Joshua M. wrote:

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 B. http://agileconsultingllc.com
[email protected]

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 B. http://agileconsultingllc.com
[email protected]

Oh, everything was perfectly correct, I just had an invalid XHTML
structure and I was too lazy to check the output source code… :wink: So
the problem was not this method.

Thanks anyway.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs