Help using options_for_select in select_tag

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.

options_for_select(@clients.map { |c| [c.name,c.id])

On Jan 4, 2008 6:08 AM, John S. [email protected]
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/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs