link_to path definition

link_to 'Check teachers', :action => :check_teachers, :id => @school.id

or

link_to 'Check teachers', "/school/check_teachers/#{@school.id}"

or you can define a named-route in config/routes.rb like this:

map.check_teachers, '/school/check_teachers/:id' :controller => :school, :action => :check_teachers

and call the url-helper generated by the named-route like this:

link_to 'Check teachers', check_teachers_path(:id => @school.id)

and you can use this id to find teachers in the controller

def check_teachers
  @school = School.find params[:id]
  @teachers = @school.teachers
  ...
end

You can define something like this in your routes.rb file.

map.connect "schools/:id/check_teachers", :controller => "schools", :action => "check_teachers"

You'd then set up your link_to as follows:

link_to "Check teachers", check_teachers_path(:id => @school.id)

You'll need to add this bit of code into the controller, as model states aren't shared between controller actions:

 def check_teachers
    @school = School.find_by_id(params[:id])
    # Then you can access the teachers with @school.teachers
  end

This is untested but should work. Just comment if you have any further issues.