Forum: Ruby on Rails date_select and HTML options?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jason (Guest)
on 2009-03-13 23:00
(Received via mailing list)
I have the following code, but can't seem to get the class attribute
to show up in the generated select elements. I saw something about a
bug/patch. However, as am still learning RoR I didn't want to jump to
conclusions. Anyone see anything wrong:

<%= f.date_select :expiration_date, :order =>
[:month, :year], :discard_day => true, :class => "dtfld" %>

I've also tried:

<%= f.date_select :expiration_date, {:order =>
[:month, :year], :discard_day => true}, :class => "dtfld" %>
Jeba M. (Guest)
on 2009-03-16 09:53
(Received via mailing list)
Try this
 <%= f.date_select :expiration_date, {:order =>
[:month, :year], :discard_day => true},{ :class => "dtfld"} %>
Jason (Guest)
on 2009-04-13 06:35
(Received via mailing list)
Thanks, that worked. Still learning when to hash it up ;)
This topic is locked and can not be replied to.