Forum: Ruby on Rails making arrays of valid values user-editable--best practice?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Roy P. (Guest)
on 2008-11-25 19:44
(Received via mailing list)
Hey All,

I've got a couple of valid-value lists that I would keep as arrays in
the appropriate model.  So for instance:

  class Person < ActiveRecord::Base
    ROLE_NAMES = ['Admin Assistant', 'Programmer', 'Investigator',
'Project Manager', 'Other']
    # blah blah blah
  end

Now I need to convert this into something the user can add values to.
The 2 options that come to mind are:
  - Make each such array a model in its own right.
  - Make a kind of meta-model that would hold all of these arrays, and
use it to populate all of these arrays at application startup.

I'm most attracted to the second option, but I'm not sure it's going to
be much less work, since I'll probably have to fake out individual CRUD
screens for each array, which seems like it could get weird.

Anybody been down this road?

Thanks!

-Roy

Roy P.
Research Analyst/Programmer
Group Health Center For Health Studies (Cancer Research Network)
(206) 287-2078
Google Talk: rpardee
This topic is locked and can not be replied to.