How can I change t开发者_Python百科he default order of the date_select helper?
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("-")
The helper offers a limited set of options. If you want to apply further customizations, you need to create your own.
精彩评论