I'm trying to make a relationship between two tables in Ruby, where I use the student and notes but when I go into localhost: 3000 / students / 1 / notes it gives me the error
I'm trying to make a relationship between two tables in Ruby, where I use the student and notes but when I go into localhost: 3000 / students / 1 / notes it gives me the error
You're saying that Note belongs to Student , and trying to access it in a way it will not allow, and will have the error response:
noMethodError in NotesController # index undefined method 'notes' for #
To resolve, just like it was done in the comments, go to the Student class and call it the .find()
@student = Student.find(params[:student_id])