Rendering a JSON object of a join-model and its associated models
问题 In a Rails ( 4.1.5 / ruby 2.0.0p481 / win64 ) application I have a many-to-many relationship between Student and Course and a join model StudentCourse which represents the association, and has an additional attribute called started (set by default on "false"). I also have added an index in the join-table made of student_id and course_id , and set a unique check on that, like this t.index [:student_id, :course_id], :unique => true, :name => 'by_student_and_course' I wanted that to be a