thx nicholas I'd thought of using serialize, but decided to just do it as yaml
so, for the moment, I'm good on my first req the third req of being able to group/type the custome field data will either be handled by structuring the yaml or I may split things into seperate colums for te diff types of data... this may help with searches a bit the second req is what's befuddling me now... with fixed field names, I can create attr_accessors for each of them and do explicit setter/ getters for each attribute... but having a dynamic list of attributes, both in count and attr name, I'm not sure how to set that up... can anybody help with that? On Jul 16, 6:02 pm, Nicholas Henry <[email protected]> wrote: > Perhaps the serialize method could be helpful: > > http://apidock.com/rails/ActiveRecord/Base/serialize/class > > Cheers, > Nicholas > > On Jul 16, 7:02 pm, lunaclaire <[email protected]> wrote: > > > I'm working on a contact management app and 3 of the requirements are: > > > * the user should be able to add additional custom Contact fields > > (e.g. an extra phone number that isnt provided in the std set of > > fields) > > * the user should be able to name fields with whatever label they want > > (e.g. one user might label with "Vacation Phone", another as "Home > > Office Phone" > > * the custom data will be typed and grouped so that we know that it's > > text data vs a phone number (for example) and so that we can get the > > list of all custom phone numbers or addresses > > > I'm more concerned with the first req right now regarding storage and > > the best way to then access and use this data, but am glad to hear > > thoughts on the others as well. > > > My thought is to have a column in the DB called "custom" that's a text > > field and then either go with a YAML style or XML for storing the > > field label and data. > > > But, what's the best way to encapsulate and do things in the model > > code to make these attributes accessible from the rest of the app in a > > way thatis transparent to those other parts of the app? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

