Forum: Ruby on Rails options_for_select and setting css class values

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A263601e858fe6bdf5d0c5277f8421ba?d=identicon&s=25 (Guest)
on 2007-05-21 22:46
(Received via mailing list)

i'm not sure if this is possible using erb (at the very least, I can't
figure it out by googling or via searching this board), so here

i'm using erb to make a select box with several hundred <option>

it looks something like this:

<%= select_tag 'controls', options_for_select( {|cpd|
["#{cpd.compound_name}.....#{cpd.trimmed_number}"]}), {:class =>
'superwide', :size => 20} %>

the above code works great...except for 1 thing.
i'd like to cycle the color of every other <option> tag using css.

obviously, i'd like to use the 'cycle' function, but how/where do i
get options_for_select to accept a value for a  css-class?
e.g. :class => 'blue_text'

i'm not even sure if this is possible....

This topic is locked and can not be replied to.