Ruby on Rails
Friday, January 19, 2018
I have addresses, people and relationships tables Addresses has no person_id field, People has no address_id field They both rely on the relationships table using has_many_through The problem is when I create a new object @address i can't assign person_id to the object because it's an unknown method so when I submit the form the controller complains unknown method person_id for @address
-- @address is being created like this @address=Person.find(params[:person_id]).addresses.new
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3db0016a-ad5a-4477-9830-efbf595b7508%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment