# Making arrays of valid values user-editable--best practice?

**URL:** <https://www.ruby-forum.com/t/making-arrays-of-valid-values-user-editable-best-practice/154134>\
**Category:** Rails\
**Created:** [November 25, 2008, 6:44pm UTC](https://www.ruby-forum.com/t/making-arrays-of-valid-values-user-editable-best-practice/154134 "2008-11-25T18:44:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpardee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e47c2d/32.png) [@rpardee](https://www.ruby-forum.com/u/rpardee)\
**Post date:** [November 25, 2008, 6:44pm UTC](https://www.ruby-forum.com/t/making-arrays-of-valid-values-user-editable-best-practice/154134/1 "2008-11-25T18:44:00Z")

</div>

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
