I am building a form to select a year from 2010 to current year.
= f.input :duration do
= f.select :duration, options_for_select(2010..@currentyear.to_i)
and it gives me a drop down list:
But if I try to do it in descending order (like 2015, 2014, 2013, 2012, 2011, 2010),
options_for_select(@currentyear.to_i..2010)
I get a blank drop down menu. What do I do?
Change this line
options_for_select(@currentyear.to_i..2010)
to
options_for_select((2010..@currentyear.to_i).to_a.reverse)