form_for(@address) in form controller says undefined local variable 'address_params'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

form_for(@address) in form controller says undefined local variable 'address_params'

fugee ohu
Something in my routes? I'm using nested resources

resources :users do
  resources :addresses
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1d5b7e8d-8bd5-44fa-9e54-24a29c1b7673%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

form_for(@address) in form controller says undefined local variable 'address_params'

Chris Vukin
Being that you've got nested resources the form is looking for the @user info too, define the user in your address controller actions too and then pass it into your form like so: ([@user, @address]). That should get you on the right path. Try a Google of 'rails form_for nested resources' and see what you discover, happy exploring!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/209dea19-0c1d-4d19-90a2-eb515799c135%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.