Displaying 1 result from an estimated 1 matches for "course_teacher".
Did you mean:
course_teachers
2006 Jan 23
3
create and update with has_many :through
I''m using Edge Rails and the new has_many :through in my code. What
I''m trying to do is modify my create and update code to use the new
relationships. I''m using a table called course_teachers for the joins.
Here is what I have so far:
def create
@course = Course.new(params[:course])
@teacher = Teacher.find(params[:primary_teacher])
@course.teachers = @teacher
if @course.save
flash[:notice] = ''Course was successfully created.''
redirect_to :ac...