From: Brian Candler Date: 2008-11-10T17:45:44+09:00 Subject: Re: design advice for newbie John Goetz wrote: > 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! This sounds fine to me, but for an alternative approach you could consider Single Table Inheritance. That is, you have separate classes for Student, Parent, Teacher etc, but they all live in the users table, and can all be considered as a User. Teacher.find(...) will automatically be restricted to User.find(:conditions => "type='Teacher'") http://ar.rubyonrails.com/classes/ActiveRecord/Base.html Scroll down to "Single table inheritance" Also, the book "Agile Web Development with Rails" has a section on this (but don't buy the 2nd edition now, wait for the 3rd edition due in December) However as already mentioned, this may be a Bad Idea. It's quite possible for the same person to be both a student and a parent, or a teacher and a trustee. Person.has_and_belongs_to_many :roles may be a better way of modelling this. Admittedly the SQL finders get a bit more awkward. -- Posted via http://www.ruby-forum.com/.