我需要从2015年开始到今年,直到当年,根据年份的变化,还应该列出从2015年开始的过去的一年
<%= select_tag "leave_emp_year", options_for_select(Date.today, :start_year => Date.today.year, :end_year => 8.years.from_now.years), prompt: "Select Year", class: "leave_emp_sort_filter",style: "width:150px !important;" %>
之前我曾经这样做过
<%= select_tag "leave_emp_year", options_for_select([[2016, 2016], [2017, 2017]]), prompt: "Select Year", class: "leave_emp_sort_filter",style: "width:150px !important;" %>