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

Hey

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 /
users.xml

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

or is there any trick …

thanks
erwin

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
end

class Dog < Animal
end

class Cat < Animal
end

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
subclass.

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
the
routing though, but I think it’s worth a shot.

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


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs