How would I find all "Exams" that belong to a "Student"?

Hi, if you have the following models

class Student < ActiveRecordBase

has_and belongs_to_many :exams


class Exam < ActiveRecordBase

has_and_belongs_to_many :students


What exams did a student take

student = Student.find
( student_id )

exams_taken = student.exams

For a better explaination of Rails relationships, I would highly recommend reading AWDwRv2 chapter 18.

Good luck,