开发者

Rails: Change default format of the date_select helper?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜