On Aug 11, 2:50 am, Mark Thomas <[email protected]> wrote:
> Hello -
>
> ActionView::TemplateError (undefined local variable or method `f' for
> #<ActionView::Base:0xb6e7b2f4>) on line #1 of app/views/listings/
> _automodels.html.erb:
> <%= f.collection_select :model, @automodels, :model, :model, {:prompt
> => "-Select a Make First-"} %>
>
> This leads me to believe that the "f" variable the rest of the fields
> in the form_for are using is not available to the newly-replaced
> "collection_select", but I'm not sure why?
Because that f referred to a form builder object created by form_for.
You're in a different scope to when you rendered the original form, in
a different request, with a different instance of the controller,
possibly on a different mongrel or even a different server. The form
builder isn't going to magically appear.
Fred
--~--~---------~--~----~------------~-------~--~----~
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 [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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---