Creating Records of Has_One Associations
When working with a model, say a User, that has a has_many
association with another model, say a Post, you can create a new post for a user like so:
What about with a has_one
association? Consider a Customer that has a has_one
association with an Account. Rails provides this method for you:
Rails also gives you a similar build
method:
Last updated