You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I am wondering how I can set up my interaction to expect has_many nested attributes in the Rails form format.
I have two classes:
class User
has_many :pets
end
class Pet
belongs_to :user
end
And when a create a form for the User model and I want to already create their pets, I can just use the fields_for helper to send a pets_attributes hash with others hash (simulating an array).
I would like to know how to expect the pets_attributes hash inside of my interaction, knowing that the pets_attributes can have n hashes because it is a has_many association.
The text was updated successfully, but these errors were encountered:
Hello! I am wondering how I can set up my interaction to expect has_many nested attributes in the Rails form format.
I have two classes:
And when a create a form for the User model and I want to already create their pets, I can just use the fields_for helper to send a pets_attributes hash with others hash (simulating an array).
Example:
The submit will be sent in this format:
I would like to know how to expect the pets_attributes hash inside of my interaction, knowing that the pets_attributes can have n hashes because it is a has_many association.
The text was updated successfully, but these errors were encountered: