Forum: Ruby on Rails date_select and HTML options?

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.
4070d2480bc3296fb94599d907a81b8c?d=identicon&s=25 Jason (Guest)
on 2009-03-13 22: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" %>
D8f444b5c1b0304a2b98d5b16da0f2f1?d=identicon&s=25 Jeba Momin (zeba)
on 2009-03-16 08:53
(Received via mailing list)
Try this
 <%= f.date_select :expiration_date, {:order =>
[:month, :year], :discard_day => true},{ :class => "dtfld"} %>
4070d2480bc3296fb94599d907a81b8c?d=identicon&s=25 Jason (Guest)
on 2009-04-13 04: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.