开发者

Rails date select options?

I have a date_select field in my rails application as follows:

<%= f.date_select :dateinstructed %>

I would like to re-order the drop down lists show they out开发者_StackOverflow中文版put as:

DD/MM/YYYY

According to what I have read you can use the :order option, but I am unsure how to actually use this option:

<%= f.date_select :dateinstructed, :order = {:day, :month, :year} %>

Obviously this isn't right, but what am I supposed to put in place of the:

:day, :month, :year

Any help would be appreciated!

Thanks,

Danny


I think it should be:

<%= f.date_select :dateinstructed, :order => [:day, :month, :year] %>

Hopefully it helps.


How about this:

  prompt: { day: 'Select day', month: 'Select month', year: 'Select year' }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜