Digging through some old stuff, I don't think this discussion every
really came to a conclusion.
I still feel the burn every time I write render :partial =>
'form', :object => f, and I believe the solution underlined below
takes care of it most of the time
Fred
On 1 Oct 2007, at 04:49, Damian Janowski wrote:
>
> On 10/1/07, Michael Koziarski <[EMAIL PROTECTED]> wrote:
>>
>>> so in render_partial, case FormBuilder does render :partial => "#
>>> {f.object.class}/_form.format.erb", :object => f (apologies for
>>> pseudoness of code) ?
>>
>> Yeah, that's what I've been doing, and depending on the
>> implementation
>> required it seems like it should be ok...
>>
>> I can see mislav's point on coupling, but it seems consistent with
>> the
>> current behaviour where:
>>
>> render :partial=>@foo -> /foos/_foo.html.erb
>
> http://pastie.caboo.se/pastes/101420
>
> This simple patch allows for render :partial => f, begin f a
> FormBuilder, to render /_form.html.erb, and being f a
> LabelledFormBuilder to render /_labelled_form.html.erb. It looks for
> any FormBuilder subclass, and also sets the local variable name to
> form, labelled_form, or whatever form builder you're using...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---