search for: students_teachers

Displaying 1 result from an estimated 1 matches for "students_teachers".

2006 May 12
2
How to declare several HABTM-relationships?
...t; ActiveRecord::Base has_and_belongs_to_many :students When I create a new student I have checkboxes to display and assign the student to a set of classrooms and teachers. This seems to work, the student is saved but only one join-table (classrooms_students) is populated with the relation. The students_teachers table is not populated. Changing the order of the HABTM-declarations will reverse the problem (ie, only the first declaration works). Is it not possible to declare several relations like this, have I just screwed up the syntax or committed some far greater sin in how I structured the database?...