Topic: Year drop down

I want to generate a drop down list based on list of year that generated dynamically starting from this year  until the next 10 year.I'm still new to rails, only learned it by learning at railstutorial.org, looking at fedena source code(the reason why I am learning ruby),  and some googling.Basically what I want to do is something like this<%= select :student, :admission_year,(Time.now.year..2022).to_a, :include_blank => {:year =>

Re: Year drop down

If i got right,
just try this
<%= date_select :student, :admission_year, {:start_year => Date.today.year, :end_year => Date.today.year+10, :discard_day => true, :discard_month => true} %>

Re: Year drop down

Hi akshay, thanks for your response, it's work fine on the form, but when I want to submit, it display this error

1 error(s) on assignment of multiparameter attributes

I think it's because your code are using date_select and my admission_year column in database is using int(4), any idea how to tackle this issue? sorry, total n00b here  don't have any experience is doing rails.