# Help using options\_for\_select in select\_tag

**URL:** <https://www.ruby-forum.com/t/help-using-options-for-select-in-select-tag/124929>\
**Category:** Rails\
**Created:** [January 3, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/help-using-options-for-select-in-select-tag/124929 "2008-01-03T20:38:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 3, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/help-using-options-for-select-in-select-tag/124929/1 "2008-01-03T20:38:16Z")

</div>

**Client**  
  
\<%= select\_tag ‘clients[]’,  
options\_for\_select(  
[[’ ',‘1’], [‘aaaa’,‘2’],  
[‘daemon’,‘3’],[‘nortel’,‘4’],[‘telefonica’,‘5’],[‘local’,‘6’],[‘otro’,‘7’]]  
),  
{ :multiple =\> true, :size =\>4 }  
%\>

Instead of using the [’…’, ‘.’] code I would like to use a method of a  
list of clients that I have.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 4, 2008, 12:12am UTC](https://www.ruby-forum.com/t/help-using-options-for-select-in-select-tag/124929/2 "2008-01-04T00:12:35Z")

</div>

options\_for\_select(@clients.map { |c| [c.name,c.id])

On Jan 4, 2008 6:08 AM, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## Instead of using the [‘…’, ‘.’] code I would like to use a method of a list of clients that I have.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
