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. ;-)
Maybe a more experienced coder can help me?
Thanks a lot
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Mar 25, 2008, at 9:49 AM, Joshua Muheim 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) > endDoes 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-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org> > 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. ;-) > > Maybe a more experienced coder can help me? > > Thanks a lot > Josh--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.orgOh, everything was perfectly correct, I just had an invalid XHTML structure and I was too lazy to check the output source code... ;-) So the problem was not this method. Thanks anyway. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---