I’m trying to build out an app with a couple of tables (people,
contacts) using single table inheritance. The people table has the
type field and is for, clients, employees, managers etc. contacts
simply holds phone numbers and email numbers. I scaffolded out person
and contact and have created the basic files below. For the life of
me can’t create a related phone number or email.
in people_controller.rb I have (model below):
person = Person.find(params[:id])
redirect_to :action => ‘edit’, :controller => ‘Phones’, :id =>
with the idea this can be called from clients or employees.
and I get undefined method `Phone’ for Person:Class
Also if the scaffolded CRUD methods exist in person will they not be
inherited by client? To get anything to work I had to scaffold client
out as well.
class Person < ActiveRecord::Base
class Client < Person
class Contact < ActiveRecord::Base
class Phone < Contact
Thanks in advance for any help,