I worked my way through the FormBuilder example in the Agile Web Development With Rails book, but I now have some questions about applying this idea to other situations. The example seems to work well for the case where I am using form_for to have a single form with fields that relate to attributes of a particular model. How can I use my custom FormBuilder for other situations? Examples: 1. Non-model fields added to form_for model form. 2. Fields for other models added using fields_for. 3. Non-model fields used for non-model forms (just using form_tag) It seems like the main benefit of using a custom FormBuilder is to enforce a consistent look across forms. It would be great to extend this to include all my forms, not just model-based forms. Thanks! Errol --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
maybe you are right cos django is separate model and form builder On Fri, 2007-07-27 at 10:26 -0700, Serengeti wrote:> I worked my way through the FormBuilder example in the Agile Web > Development With Rails book, but I now have some questions about > applying this idea to other situations. > > The example seems to work well for the case where I am using form_for > to have a single form with fields that relate to attributes of a > particular model. > > How can I use my custom FormBuilder for other situations? Examples: > > 1. Non-model fields added to form_for model form. > 2. Fields for other models added using fields_for. > 3. Non-model fields used for non-model forms (just using form_tag) > > It seems like the main benefit of using a custom FormBuilder is to > enforce a consistent look across forms. It would be great to extend > this to include all my forms, not just model-based forms. > > Thanks! > Errol > > > >--~--~---------~--~----~------------~-------~--~----~ 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 further inspection, it looks like I can specify a builder with fields_for. That still leaves case #1 and case #3 (see above). Does anybody have any thoughts on this? On Jul 27, 12:42 pm, cunheise <cunhe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> maybe you are right cos django is separate model and form builder > > On Fri, 2007-07-27 at 10:26 -0700, Serengeti wrote: > > I worked my way through the FormBuilder example in the Agile Web > > Development With Rails book, but I now have some questions about > > applying this idea to other situations. > > > The example seems to work well for the case where I am using form_for > > to have a single form with fields that relate to attributes of a > > particular model. > > > How can I use my custom FormBuilder for other situations? Examples: > > > 1. Non-model fields added to form_for model form. > > 2. Fields for other models added using fields_for. > > 3. Non-model fields used for non-model forms (just using form_tag) > > > It seems like the main benefit of using a custom FormBuilder is to > > enforce a consistent look across forms. It would be great to extend > > this to include all my forms, not just model-based forms. > > > Thanks! > > Errol--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
So, has anybody used a custom form builder? On Jul 30, 3:56 pm, Serengeti <market...-XDDYW7GRA3etG0bUXCXiUA@public.gmane.org> wrote:> On further inspection, it looks like I can specify a builder with > fields_for. That still leaves case #1 and case #3 (see above). Does > anybody have any thoughts on this? > > On Jul 27, 12:42 pm, cunheise <cunhe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > maybe you are right cos django is separate model and form builder > > > On Fri, 2007-07-27 at 10:26 -0700,Serengetiwrote: > > > I worked my way through the FormBuilder example in the Agile Web > > > Development With Rails book, but I now have some questions about > > > applying this idea to other situations. > > > > The example seems to work well for the case where I am using form_for > > > to have a single form with fields that relate to attributes of a > > > particular model. > > > > How can I use my custom FormBuilder for other situations? Examples: > > > > 1. Non-model fields added to form_for model form. > > > 2. Fields for other models added using fields_for. > > > 3. Non-model fields used for non-model forms (just using form_tag) > > > > It seems like the main benefit of using a custom FormBuilder is to > > > enforce a consistent look across forms. It would be great to extend > > > this to include all my forms, not just model-based forms. > > > > Thanks! > > > Errol--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, and its been a big productivity boost once i worked out how to apply to html wrappers to form fields in the way i wanted. However, like you, i would like to use if for non-model forms and for fields_for forms. I haven''t put that high enough on the priority list to investigate, although i did note that fields_for is in the context of form_for so I suppose there is some hope there - but I don''t know how to get under the covers of fields_for. Cheers, --Kip On Aug 2, 12:51 am, Serengeti <market...-XDDYW7GRA3etG0bUXCXiUA@public.gmane.org> wrote:> So, has anybody used a custom form builder? > > On Jul 30, 3:56 pm, Serengeti <market...-XDDYW7GRA3etG0bUXCXiUA@public.gmane.org> wrote: > > > On further inspection, it looks like I can specify a builder with > > fields_for. That still leaves case #1 and case #3 (see above). Does > > anybody have any thoughts on this? > > > On Jul 27, 12:42 pm, cunheise <cunhe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > maybe you are right cos django is separate model and form builder > > > > On Fri, 2007-07-27 at 10:26 -0700,Serengetiwrote: > > > > I worked my way through the FormBuilder example in the Agile Web > > > > Development With Rails book, but I now have some questions about > > > > applying this idea to other situations. > > > > > The example seems to work well for the case where I am using form_for > > > > to have a single form with fields that relate to attributes of a > > > > particular model. > > > > > How can I use my custom FormBuilder for other situations? Examples: > > > > > 1. Non-model fields added to form_for model form. > > > > 2. Fields for other models added using fields_for. > > > > 3. Non-model fields used for non-model forms (just using form_tag) > > > > > It seems like the main benefit of using a custom FormBuilder is to > > > > enforce a consistent look across forms. It would be great to extend > > > > this to include all my forms, not just model-based forms. > > > > > Thanks! > > > > Errol--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---