I have a typical class called Users. Each user has a Role (one of
administrator, teacher, student, parent, or trustee). How do I design my
controller/views/routes to best implement links to administer each
group, like this:
Right now, each of these links activates the user_controller and lists
all users (for example the student admin link: <%= link_to “Student
Administration”, :controller => ‘users’, :action => ‘index’ %>).
I would like each link to get only the users having the appropriate
role. I know I can create the link_to with an additional parameter
(e.g., role => ‘teacher’) which will change the route to
‘/users?role=teacher’, but is this the correct, RESTful, Rails way of
doing this? If not, can you please point me in the right direction or
towards some guidelines? Thanks!