# A good way to store some profile-information?

**URL:** <https://www.ruby-forum.com/t/a-good-way-to-store-some-profile-information/127466>\
**Category:** Rails\
**Created:** [January 29, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/a-good-way-to-store-some-profile-information/127466 "2008-01-29T15:58:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [January 29, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/a-good-way-to-store-some-profile-information/127466/1 "2008-01-29T15:58:59Z")

</div>

What would be a good way to store profile-information, in the cases  
where the information can be selected from a list of choices? i.e.  
gender (male,female), religion or marital status.

The lists don’t change, so putting that in the db doesn’t seem like a  
good idea, but how do i put something like this in a model?

---

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [January 29, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/a-good-way-to-store-some-profile-information/127466/2 "2008-01-29T16:49:40Z")

</div>

If you’re asking how to store the options for the user to choose from,  
you ought to just put them in your view. If you’re asking how to store  
the user’s selections, they ought to go in your database. If you’re  
asking something else then I didn’t understand your question 🙂

---

<div class="post-metadata">

**Author:** ![peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://www.ruby-forum.com/u/peter)\
**Post date:** [January 29, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/a-good-way-to-store-some-profile-information/127466/3 "2008-01-29T17:50:47Z")

</div>

i meant a good way to store the selections in the database,for example  
should i store someone’s marital status just as a string, using…

validates\_inclusion\_of :marital\_status, :in =\> %w(single married)

…or would it be better to just use a number, and if so: how would i  
map those numbers in a handy way in my model (constants?) so i can use  
just the corresponding options (1=single,2=married,etc) elsewhere in a  
nice way.
