thebusyant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-21 20:45 UTC
options_for_select and setting css class values
Hi, 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 goes... i''m using erb to make a select box with several hundred <option> values it looks something like this: <%= select_tag ''controls'', options_for_select(@controls.map {|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.... TIA! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---