Just wondering if anyone could point me to a good explanation of why the latest way of doing things does not include using something like _form.html.erb partials in RESTful rails 2.0?? Why did we move away from partials, etc?? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you gave us more information as to what your problem was, then maybe we can help. Ranting & Raving about it doesn''t help us. Rails 2.0 is using partials the exact same way all previous versions have been. On Jan 9, 2008 8:01 AM, rails.impaired <resident.moron-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Just wondering if anyone could point me to a good explanation of why > the latest way of doing things does not include using something like > _form.html.erb partials in RESTful rails 2.0?? Why did we move away > from partials, etc?? > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I guess what you mean is why is the _form.html.erb not separated from the new.html.erb and edit.html.erb views any more when you generate a scaffold. Partials are still there and very much in favour where appropriate. In the context of the scaffold, I think they have moved away from using them for 2 reasons: 1. The use of partials for the inner section of the form prevent us using the block level variable (usually f) to indicate the model association of the form_for (e.g. form_for(:post, posts_url do |f| f.text_area(:title) end ) 2. Often the edit form is different to the new form. This allows us to be ready to make these changes when they occur Other than those reasons i can''t think of any other good ones for making the change, but especially (1) seems to be the most likely reason. Nothing to stop you doing it for your views, either pass the "f" variable through in the :locals => {} hash of the partial, or use the fields_for method within the partial. On Jan 8, 10:47 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you gave us more information as to what your problem was, then maybe we > can help. Ranting & Raving about it doesn''t help us. > > Rails 2.0 is using partials the exact same way all previous versions have > been. > > On Jan 9, 2008 8:01 AM, rails.impaired <resident.mo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Just wondering if anyone could point me to a good explanation of why > > the latest way of doing things does not include using something like > > _form.html.erb partials in RESTful rails 2.0?? Why did we move away > > from partials, etc?? > > -- > Ryan Bigghttp://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xavier Noria
2008-Jan-09 11:10 UTC
Re: What happened to _form.rhtml partial in rails 2.0??
On Jan 9, 2008, at 11:57 AM, Wildtangent wrote:> Nothing to stop you doing it for your views, either pass the "f" > variable through in the :locals => {} hash of the partial, or use the > fields_for method within the partial.Another option is to move the entire form into the partial using the new idiom form_for(@model). It was customary to leave it outside to be able to write different actions by hand in the new/edit templates, but this new idiom DRYfies that. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---