Single inheritance 2 models OK, but what about the controller?


I am using a single inherance table :

class User < ActiveRecord::Base

class Member < User

I would like to use only ONE controller

accessing GET /members.xml should be equivalent to GET /

should I have a member_controller and redirect all CRUDs to the
equivalent action in users ?

or is there any trick …


I was about to ask the same question, and saw yours at the top.

I have the same setup

table: animals

class Animal < ActiveRecord::Base

class Dog < Animal

class Cat < Animal

I just want to know how and pros and cons of using 1 controller / 1
view for each action, or a controller and set of views for each

You should be able to define a new members_controller like this:

class MembersController < UsersController; end

It should get all the methods from UsersController. Not sure if it’ll do
routing though, but I think it’s worth a shot.

On Feb 7, 2008 10:16 PM, Erwin [email protected] wrote:

Ryan B.

Feel free to add me to MSN and/or GTalk as this email.