> I love form_for, but I really hate
>
> <% form_for :person, @person, :url => {...} do |f| %>
> ...
> <%= render :partial => 'form', :locals => {'f' => f}
> ...
> <% end %>
>
> I've been thinking of instead allowing
>
> <% form_for :person, @person, :url => {...} do |f| %>
> ...
> <%= f.partial 'form' %>
> ...
> <% end %>
Isn't this what :object => f is for?
<% form_for :person, @person, :url => {...} do |f| %>
<%= render :partial => 'fields', :object => f
<% end %>
_fields.erb:
<%= fields.text_field :name %> (local variable is the name of the
partial)
<%= fields.text_field :age %>
Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---