but this solution show me all students in the db. I wish I had only the
students registered in the same course of exam.
I don't know how filter the array and put it in the multiple selection.
I think you need to add a relationship between a course and a user and use
that relationship to figure out that list of student choices eligible for
the exam.
I think you need to add a relationship between a course and a user and
use that relationship to figure out that list of student choices eligible
for the exam.
In this project, any student can join only one course. In fact, the
relationship between students and course is:
belongs_to :course # in student.rb
has_many :students # in course.rb
I create 2 views to manage Exams table. One, to insert title, date and
course_id; another one to join stundents and an existed exam. In this
second view I wish to present to a user (in a multiple selection, or
something like that) only the students associated to a course_id of
exam.
To populate the Registrations table, I use a multiple selection, but I'm
not able to filter the students.
What do you mean by "the same course of exam".
I hope the graph help to understand... and I hope my english isn't so
bad