If I put f.fields_for :city, this gets generated:

<select name="user[city][id]" id="user_city_id">

and I get an AssociationMismatch saying
ActiveRecord::AssociationTypeMismatch: City(#36862620) expected, got 
Hash(#21169932)

If I put f.fields_for :city_attributes, this gets generated:

<select name="user[city_attributes][id]" id="user_city_attributes_id">

Which looks more like what the nested form would accept.

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to