开发者

Rails: Change default format of the date_select helper?

开发者 https://www.devze.com 2022-12-21 14:40 出处:网络
How can I change t开发者_Python百科he default order of the date_select helper? view date_select("set_date", "written_on", :order => [:year, :month])

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消