Order year in rails date_select

时间:2015-09-19 18:50:09

标签: ruby-on-rails ruby-on-rails-4

f.date_select(:birthday, prompt: {
                  day: 'Select day', month: 'Select month', year: 'Select year'
                  }, end_year: Time.now.year-13, start_year: 1900, required: true)

It shows start_year first and end_year last: 1900 1901 .. .. 2002

I want 2002 first and 1900 at the bottom of the select box. Couldn't find anything in rails documentation and google. Any help will be appreciated. Thanks

1 个答案:

答案 0 :(得分:2)

只需交换DummyClassend_year即可。

在你的情况下:

start_year