Hi,
I have some problems creating new rows based on relationship
I’m using has_and_belongs_to_many
Groups <=> ContactsGroups <=> Contacts
When I type in Irb this:
Group.find(4).contacts
I get the following result, which is fine
=> [#<Contact:0x493afa4 @attributes={“accepted_at”=>nil…
But when I try to create new contact I get error
Group.find(4).contacts.create
=> NoMethodError: undefined method `group_id’
How can I create new contact through Group.find(4).contacts.create ?
Thanks for any response