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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.