Hey everyone,
I have a tendency to be way too abstracted, I agree... however, I
think this is very useful.
This is what I have: (single table inheritance)
a model AbstractPerson (with nothing in it)
has_many :names, :class_name => ''PersonName''
a model Garbageman < AbstractPerson
a model Teacher < AbstractPerson
and so on...
also, a model "PersonName" (obviously)
belongs_to :abstractperson
Now, evidently each person can have more than one name.
My "Interesting Problem" crops up when I want to create a form for
entering the data in for a garbageman object. Of course I''m going to
want to enter the name data into this form. Several ways of doing
this pop into my head.
The best way for me, would be to put things like:
<p><label for="garbageman_name">Name</label> <%=
text_field
(''garbageman'', ''name'') %></p>
But I''m fairly sure that this doesn''t work.
What''s the best way to do this, do you think?