Displaying 1 result from an estimated 1 matches for "mymodelcollect".
2006 May 04
1
Instance or local vars for field helpers in partial template
...@mymodel to be a model object defined as an instance variable in
the controller.
However, if I am rendering a partial template, I either have:
render :partial => ''mything'', :object => @mymodel
or
render :partial => ''mything'', :collection => @mymodelcollection
Now, inside the template, the @mymodel object is available as the
*local* variable mything (same as template name).
If I have a field helper, I cannot now use:
text_field :mything, :attribute
because text_field expects @mything (an instance variable).
I can get around this my putting at...