# Problem with options\_for\_select

**URL:** <https://www.ruby-forum.com/t/problem-with-options-for-select/190153>\
**Category:** Rails\
**Created:** [June 17, 2010, 10:37am UTC](https://www.ruby-forum.com/t/problem-with-options-for-select/190153 "2010-06-17T10:37:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [June 17, 2010, 10:37am UTC](https://www.ruby-forum.com/t/problem-with-options-for-select/190153/1 "2010-06-17T10:37:08Z")

</div>

Hi,  
I have a problem with the form select. In the value field I have the  
generated html…

\<%= f.select :brand\_id,  
options\_for\_select([[‘Brands’, 0]] +  
@search\_brands.map { |b| [b.name, b.id]}),  
{:id =\> ‘cbxBrand’, :tabindex =\> (@tabindex += 1)} %\>

This is the html:

\<option value="0"\>Marques\</option\> \<option value="276987689"\>Activ distribution\</option\>

Am i forgetting a parameter or something?

Greg

---

<div class="post-metadata">

**Author:** ![gregm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregm](https://www.ruby-forum.com/u/gregm)\
**Post date:** [June 17, 2010, 11:19am UTC](https://www.ruby-forum.com/t/problem-with-options-for-select/190153/2 "2010-06-17T11:19:19Z")

</div>

Ok, I find out, it works without the options\_for\_select
