# Question about :include\_blank =\> true

**URL:** <https://www.ruby-forum.com/t/question-about-include-blank-true/111964>\
**Category:** Rails\
**Created:** [August 13, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/question-about-include-blank-true/111964 "2007-08-13T22:31:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dparkmit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dparkmit](https://www.ruby-forum.com/u/dparkmit)\
**Post date:** [August 13, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/question-about-include-blank-true/111964/1 "2007-08-13T22:31:05Z")

</div>

Hi All,

When you include the option “:include\_blank =\> true”, then the select  
function includes a blank option. How do you specify text for that  
option? Many thanks from this newbie for your help!

For instance, rather than getting:

admin user

I’d like to get

[Select One] admin user

---

<div class="post-metadata">

**Author:** ![dparkmit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dparkmit](https://www.ruby-forum.com/u/dparkmit)\
**Post date:** [August 13, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/question-about-include-blank-true/111964/2 "2007-08-13T22:34:06Z")

</div>

> I’d like to get
> 
> [Select One] admin user

I think that might defeat the purpose as in your second example if left  
on  
the initial selection the form will be submitted with a value of  
“[Select  
One]” for that field which is probably not what you want.

What you want is:

[Select One]

Which you can do by just making it the first available option.

---

<div class="post-metadata">

**Author:** ![dparkmit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dparkmit](https://www.ruby-forum.com/u/dparkmit)\
**Post date:** [August 13, 2007, 10:47pm UTC](https://www.ruby-forum.com/t/question-about-include-blank-true/111964/3 "2007-08-13T22:47:07Z")

</div>

Thanks for the quick response. But how would you insert that extra  
option into the select function?

I’d really like to use the following code:

collection\_select(:user, :type\_id, types, :id, :type, {:include\_blank  
=\> true})

i’m not sure how to insert an option into the output for this  
function.

---

<div class="post-metadata">

**Author:** ![dparkmit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dparkmit](https://www.ruby-forum.com/u/dparkmit)\
**Post date:** [August 13, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/question-about-include-blank-true/111964/4 "2007-08-13T22:58:09Z")

</div>

dparkmit wrote:

> When you include the option “:include\_blank =\> true”, then the select  
> function includes a blank option. How do you specify text for that  
> option? Many thanks from this newbie for your help!

I think you want the :prompt option.

Eric
