Forum: Ruby on Rails Is it possible to alternate row colors for collection_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F8d196408f5a602e0fed6096d41ed5f9?d=identicon&s=25 gm gm (gmoniey)
on 2009-04-23 20:45
Hi,

I have something as such:

collection_select(:obj, :types, @types, :id, :name, {}, {:multiple =>
true, :size => 4})

and I want the row colors to alternate. This is easy to do when manually
building the options tags (as you just add a class name for every other
tag), but I cant figure out how to do it the rails way

Any suggestions?

Thanks.
This topic is locked and can not be replied to.