On 27 Sep 2007, at 01:59, Michael Koziarski wrote:
>
>> Maybe the form builder classes aren't the place for this
>> but I couldn't think of another way.
>
> Perhaps:
>
> <% form_for ... do |f|
> <%= render :partial=>f %>
> <% end %>
>
> The enhance the polymorphic code to take account of FormBuilder and
> make a FormBuilder for a Customer build:
>
> customers/_form.format.erb ?
>
so in render_partial, case FormBuilder does render :partial => "#
{f.object.class}/_form.format.erb", :object => f (apologies for
pseudoness of code) ?
As long as you don't have more than one form per model that you want
easily accessible (and even if you did have that I suppose that falls
under the general 'make the common case easy etc...', as it's not
that bad having to type out the :object if you do have some
complicated nesting/set of form partials.
Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---