# Concatenating to an array constant for options\_for\_select

**URL:** <https://www.ruby-forum.com/t/concatenating-to-an-array-constant-for-options-for-select/166493>\
**Category:** Rails\
**Created:** [April 26, 2009, 4:41am UTC](https://www.ruby-forum.com/t/concatenating-to-an-array-constant-for-options-for-select/166493 "2009-04-26T04:41:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [April 26, 2009, 4:41am UTC](https://www.ruby-forum.com/t/concatenating-to-an-array-constant-for-options-for-select/166493/1 "2009-04-26T04:41:40Z")

</div>

Hello,

I have the following code:

\<%= select\_tag :role, options\_for\_select(Project::COMPANY\_ROLES.concat  
([‘Other…’]), @relationship.role), :class =\> ‘selectInput  
hasOtherValue’ %\>

For some reason it concatenates “Other…” to COMPANY\_ROLES but saves  
this past the view that was loaded.

1st Run = 1 option of “Other…”  
2nd Run = 2 options of “Other…”  
3rd Run = 3 options of “Other…”

I simply want it to concatenate during run-time and not save state.

Any ideas?

Thanks!

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [April 26, 2009, 5:58pm UTC](https://www.ruby-forum.com/t/concatenating-to-an-array-constant-for-options-for-select/166493/2 "2009-04-26T17:58:18Z")

</div>

This does the trick:

\<%= select\_tag :role, options\_for\_select(Project::COMPANY\_ROLES +  
[‘Other…’], @relationship.role), :class =\> ‘selectInput  
hasOtherValue’ %\>
