Displaying 1 result from an estimated 1 matches for "sports_users".
Did you mean:
posts_users
2006 Jul 27
2
Saving records in mySQL for many-to-many relationship
...User.find(6)
@c.sports = Sport.find(1)
end
And I keep getting this error:
undefined method `each'' for #<Sport:0x36a3488
@attributes={"name"=>"Basketball", "id"=>"1"}>
Im pretty sure that I set up the database right. I have a sports_users
table with sport_id and user_id. And when I put records into the
database manually, the records are finding each other, Im just having
trouble getting this to work from a submit form. Anybody encounter this?
--
Posted via http://www.ruby-forum.com/.