Forum: Ruby on Rails Recursive Tables + a single table inheritance Q

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joe C. (Guest)
on 2006-04-18 20:00
Hi, what is the RoR way of handling a recursive table?  I'm a little
confused how to set this up in the model.

My example is the employee table.  Employees holds a list of employees,
and a recursive link to itself to show org structure.

id (pk)
type -- this is for single table inheritance... ie supervisor, manager,
employee_id -- (fk's to this is the id of the employee's

Also, I'm setting this up using single table inheritance.  If I wanted a
different view for each "type" would I set up a completely different
View? Could I use a different layout for each?
This topic is locked and can not be replied to.