Reputation: 9462
How can I change the default order of the date_select helper?
Upvotes: 1
Views: 4633
Reputation: 570
view
date_select("set_date", "written_on", :order => [:year, :month])
controller
date = (params[:set_date])? params[:set_date] : DateTime.now
date = date.to_a.sort.collect{|c| c[1]}.join("-")
Upvotes: 2
Reputation: 176362
The helper offers a limited set of options. If you want to apply further customizations, you need to create your own.
Upvotes: 1