Home Get dropdown selected value and fetch data from join table
 I have two tables: class Assessment has_many :students, through: :assessment_students end class Student has_many :assessments, through: :assessment_students end class AssessmentStudent belongs_to :student belongs_to :assessment end  There is another table: class Classroom has_many :classroom_students end  When a new assesssment is created, user can choose a classroom to which assessment belongs and all students of that classroom is assigned to the assessment. Join table (AssessmentStudent) and Assessment table get the updated values. On show.html of Classroom, I have to show all assessments of that classroom as a dropdown. I am able to get this dropdown displaying the assessments. Now based on the assessment chosen in the dropdown, I have to get student details assigned to that particular assessment (This data is available in join table AssessmentStudent). However, I am not sure how to get the selected dropdown value and loop through all records of AssessmentStudent join table and get the relevant student data.