Setting a CSS class on select helper

Dan Weaver wrote:

Hi,

I'm trying to put a css class on a dropdown box built using a select
helper (to make it wider) but I can't get it to take. I thought for
sure, and from what I've seen elsewhere, this code should work:

<%= f.select :month, 1..12, :selected => Time.now.month.to_i, :class =>
'monthSelect' %>

You have to make sure Ruby sees two separate hash arguments:

<%= f.select :month, 1..12, {:selected => Time.now.month.to_i},
                             :class => 'monthSelect' %>

Oh yeah! That's much cleaner. Thanks for the reply.