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 :D
=> [#<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 :D
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---