adding custom fields dynamically to a model
Posted
by pankajbhageria
on Stack Overflow
See other posts from Stack Overflow
or by pankajbhageria
Published on 2010-04-28T04:18:54Z
Indexed on
2010/04/28
4:23 UTC
Read the original article
Hit count: 282
I have a model called List which has many records:
class List
has_many :records
end
class Record
end
The table Record has 2 permanent fields: name, email.
Besides these 2 fields, for each List a Record can have 'n' custom fields.
For example: for list1 I add address(text), dob(date) as custom fields. Then while adding records to list one, each record can have values for address and dob.
Is there any ActiveRecord plugin which provides this type of functionality?
Or else could you share your thoughts on how to model this?
Thanks in advance,
Pankaj
© Stack Overflow or respective owner