views:

22

answers:

2

Do I have to create a new instance of the join table and set the values or can I say something like

student.classes.add(class) and that will work?

Sincerely, tesmar

+1  A: 

No, it is not necessary to create a new instance of the join table. To add a new class you can simply use:

student.classes << class

student.save

bye, Ale