in controller:
@teacher = Teacher.find(...your code...)
then all his students can be accessed:
@teacher.students
for example
@teacher.students.each do |student|
...do something with student
end
How to student as a nested resource to teacher.
Such that when I perform a show action an albums, I should be able to
view only the photos associated with it and not all the photos of the
table