How to save a nested resource in ActiveRecord using a single form (Ruby on Rails 5)
问题 I have two entities with a many-to-one relationship. User has many Addresses. When creating a User I want the form to also create a single Address. The entities are nested. Approach 1: The code below works, but only saves the User, no associated Address. Reading around, I thought that the accepts_nested_attributes_for would automatically save the address. I'm not sure, but it may be that this isn't working because the parameters I'm getting into the Controller don't actually appear to be