Also, has_many :through allows you to add additional fields to the join table (:student_courses). for example if you wanted to store a grade, you would want it here in :student_courses, because it is only relevant to that student for that course.
On Mar 30, 12:24 pm, Piotroslav <[email protected]> wrote: > http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMet... > > "There are two ways to build a many-to-many relationship. > The first way uses a has_many association with the :through option and > a join model, so there are two stages of associations. > For the second way, use has_and_belongs_to_many in both models. This > requires a join table that has no corresponding model or primary key." -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
