标签: ruby-on-rails ruby date datetime select
我有什么
options_for_select(1995..Date.today.year)
我想用蛮力的方式
options_for_select((1995..Date.today.year).to_a.reverse)
如何在不必反转数组的情况下重写第二个options_for_select?
options_for_select
答案 0 :(得分:3)
您可以改为使用downto:
downto
options_for_select(Date.today.year.downto(1995))