# Easy one

**URL:** <https://www.ruby-forum.com/t/easy-one/91057>\
**Category:** Rails\
**Created:** [April 4, 2007, 6:30am UTC](https://www.ruby-forum.com/t/easy-one/91057 "2007-04-04T06:30:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rails.impaired](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d9b06d/32.png) [@rails.impaired](https://www.ruby-forum.com/u/rails.impaired)\
**Post date:** [April 4, 2007, 6:30am UTC](https://www.ruby-forum.com/t/easy-one/91057/1 "2007-04-04T06:30:40Z")

</div>

I have the following piece of code in an app:

```
@states = LookupValue.find(:all,
                            :conditions => ['record_type = ?',

```

‘STATE’],  
:order =\> “char\_value\_1”).map {|u|  
[u.char\_value\_1, u.id] }

This builds a list of codes and descriptions from a common values  
table. The values are used in a “select” on a page. The page works  
fine, however, we would like to have an empty inserted at the  
beginning of the list to force the user to actually select an item  
from the list. Any suggestions how I can insert an empty/blank code/  
description to @states ??

Thanks,

rails.impaired

---

<div class="post-metadata">

**Author:** ![rails.impaired](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d9b06d/32.png) [@rails.impaired](https://www.ruby-forum.com/u/rails.impaired)\
**Post date:** [April 4, 2007, 6:38am UTC](https://www.ruby-forum.com/t/easy-one/91057/2 "2007-04-04T06:38:30Z")

</div>

rails.impaired wrote:

> I have the following piece of code in an app:
> 
> ```
> @states = LookupValue.find(:all,
> :conditions => ['record_type = ?',
> 
> ```
> 
> ‘STATE’],  
> :order =\> “char\_value\_1”).map {|u|  
> [u.char\_value\_1, u.id] }
> 
> This builds a list of codes and descriptions from a common values  
> table. The values are used in a “select” on a page. The page works  
> fine, however, we would like to have an empty inserted at the  
> beginning of the list to force the user to actually select an item  
> from the list. Any suggestions how I can insert an empty/blank code/  
> description to @states ??
> 
> Thanks,
> 
> rails.impaired

select(“something”, “something\_id”, @states, { :include\_blank =\> true })

read more here

> **[ActionView::Helpers::FormOptionsHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M000506)**
>
> Provides a number of methods for turning different kinds of containers into a set of option tags.
