How to start the date_select in the middle of the years in the filed
I am using the Rails date_select helper.开发者_运维技巧
:start_year => Time.now.year
:end_year => 1910
I would like the year the user sees when they click to be 1980 which is not the start year or end year.
Is there a way to do this with jquery?
Thanks
You can pass the Date object to the :default
option.
In your case it's date_select(:start_year => Time.now.year, :end_year => 1910, :default => Date.new(1980) )
Docs for the date_select helper
精彩评论