18 May 03:37
Re: Cleanest syntax for form partial?
From: Ix Quic <ixquic696969@...>
Subject: Re: Cleanest syntax for form partial?
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-05-18 01:37:52 GMT
Subject: Re: Cleanest syntax for form partial?
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-05-18 01:37:52 GMT
In Rails 2.1: <% form_for ... do |f| %> <%= render :partial => f %> which renders _form.html.erb (*) where the local variable is called form. *) or _foobar_form.html.erb if you use a custom FoobarFormBuilder http://dev.rubyonrails.org/changeset/8646 Michael Slater wrote: > When I'm in a form block and am including a partial, I use: > > <%= render :partial => 'form', :locals => {:f => f} %> > > Is there a cleaner way to write this? Something new in Rails 2 maybe? > > Michael --~--~---------~--~----~------------~-------~--~----~ 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@... To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@... For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
RSS Feed