Created
April 7, 2012 15:59
-
-
Save danbt79/2329943 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Musings on <select> inputs: | |
# (aka: how Rails is doing it right.) | |
# This is what Rails looks like in the books: | |
f.date_select :end_date | |
# This is what Rails looks like in production: | |
f.date_select :end_date, {:include_blank => false, :start_year => Time.zone.now.year, :end_year => (Time.zone.now + 2.years).year, :order => [:month, :day, :year], :prompt => {:month => t(:select_month), :day => t(:select_day), :year => t(:select_year)} }, {:class => 'datetime_picker'} | |
# The second may be long, but it's still just a single line. | |
# It is also: | |
# * pre-populated with our objects values | |
# * ordered as the client requested. | |
# * styled with a beautiful jQuery date picker. | |
# * sensitive to the User's timezone. | |
# * translated into 8 different languages. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment