Setting a CSS class on select helper

Dan Weaver wrote:


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:

<%= :month, 1..12, :selected =>, :class =>
'monthSelect' %>

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

<%= :month, 1..12, {:selected =>},
                             :class => 'monthSelect' %>

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