Sean ~ <br><br>I definitely thing this is a good use of STI. How you break out the functionality will largely depend on how common elements are between the different types of people. For instance you say that the search results will look the same so lets say you have a controller called Person and an action called Search. This action could be shared by all Persons, and use the same view. When you go to the detail view however, you say you will have different needs. You could create individual controllers, but again unless there is a lot of functionality, I would put it in the Person Controller, staff_detail action, student_detail action, and so on. The urls would look nice too:
<br><br>/person/staff_detail<br>/person/student_detail... and so on.<br><br>Anyhow just some thoughts to get you going.<br><br>~ Ben<br><br><div><span class="gmail_quote">On 1/30/06, <b class="gmail_sendername">Sean Hussey
</b> <<a href="mailto:seanhussey@gmail.com">seanhussey@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi everyone,
<br><br>We have different populations of people here at our college: Staff,<br>Faculty, Students, Alumni (and a host of "Other" that I'll worry about<br>another day.<br><br>I originally had only Staff and Faculty loaded in under a Person model
<br>using a Personnel controller. Now I want to add the students in, so I<br>thought STI might be the way to go:<br><br>class Person < AR::Base<br>end<br>class Staff < Person<br>end<br>class Faculty < Person<br>
end<br>class Student < Person<br>end<br><br>My question is, where do I put everything? They'll all have similar<br>search result listings, different info detail listings, the same<br>"check password" and "change password" functions.
<br><br>I think it sounds nice to have one controller, but then the list and<br>search methods turn UGLY when trying to account for what the user is<br>actually looking for. My search methods are already ugly with all the
<br>checking for whatever attribute the user is trying to search on.<br><br>Multiple controllers would break it out, but then there wouldn't be<br>much that's DRY about it.<br><br>Where to go? What to do?<br><br>Thanks,<br>
<br>Sean<br>_______________________________________________<br>Rails mailing list<br><a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails">
http://lists.rubyonrails.org/mailman/listinfo/rails</a><br></blockquote></div><br><br clear="all"><br>-- <br>Ben Reubenstein<br><a href="http://www.benr75.com">http://www.benr75.com</a>