Hack ActionView's date_select helper to apply individual class names to select tags.
For better or worse, in all its glory:
<%=
date_order = [:month, :day, :year]
date_class = lambda { date_order.pop.to_s }
def date_class.to_s ; self.call ; end
form.date_select(:date, { order: date_order.dup }, { class: date_class })
%>
Disclaimer: This is either a protip, or reason to hide in shame :).
"Sometimes it's both" - @StarrHorne
Written by joshuap
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#