# Enum

**URL:** <https://www.ruby-forum.com/t/enum/98182>\
**Category:** Rails\
**Created:** [January 28, 2006, 5:20am UTC](https://www.ruby-forum.com/t/enum/98182 "2006-01-28T05:20:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zbyte\_pepsi-hola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/b5e925/32.png) [@zbyte\_pepsi-hola](https://www.ruby-forum.com/u/zbyte_pepsi-hola)\
**Post date:** [January 28, 2006, 5:20am UTC](https://www.ruby-forum.com/t/enum/98182/1 "2006-01-28T05:20:01Z")

</div>

When I do scaffold generated code for a table that has “enum” in it and  
i  
goto to the “new” button, no options are given. Anyway i could automate  
it  
so i can get a drop down box when using enums?

---

<div class="post-metadata">

**Author:** ![zbyte\_pepsi-hola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/b5e925/32.png) [@zbyte\_pepsi-hola](https://www.ruby-forum.com/u/zbyte_pepsi-hola)\
**Post date:** [January 28, 2006, 5:41am UTC](https://www.ruby-forum.com/t/enum/98182/2 "2006-01-28T05:41:17Z")

</div>

OK, let me restate this, i looked at the wiki but it seems cumbersome,  
isn’t  
there a helper or plugin, or something to reduce code redundancy when  
doing  
enums?

---

<div class="post-metadata">

**Author:** ![zbyte\_pepsi-hola](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/b5e925/32.png) [@zbyte\_pepsi-hola](https://www.ruby-forum.com/u/zbyte_pepsi-hola)\
**Post date:** [January 30, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/enum/98182/3 "2006-01-30T13:56:48Z")

</div>

I _think_ mysql is really the only db that supports enums, that’s  
probably why rails doesn’t bother with them.

Personally, I don’t think enums should be used, because my opinion is  
that the data validation should be done at a higher level (in this case  
ActiveRecord).

So just use a varchar in your table and use validates\_inclusion\_of in  
your model.

-Jonny.

zbyte pepsi-hola wrote:

> OK, let me restate this, i looked at the wiki but it seems cumbersome,  
> isn’t  
> there a helper or plugin, or something to reduce code redundancy when  
> doing  
> enums?
