Topic: CSS class to select?

How can I pass a css classs to
<%= f.select(:brand,@brands) %>

like i pass it here:
<%= f.text_field :model, :class => "text_box" %>


It is not working for the select menu in the same way!

Re: CSS class to select?

try this

<%= f.select(:brand, @brands, {}, {:class => "some-class"}) %>

http://api.rubyonrails.org/classes/Acti … ml#M001624

the signature of select is
method, choices, options = {}, html_options = {})
so you have to pass the options as an empty hash before you can pass in the html options hash
this might also work?

<%= f.select(:brand, @brands, :html_options => {:class => "some-class"}) %>

Re: CSS class to select?

Thanx a lot!