Question: I am using drop down for selecting year in my form. How do I make my drop down defaults to current year. By using select\_year method, we can use like

`<%= select_year (Date.today, start_year: Date.today.year-1, end_year: Date.today.year+1) %>`

Similarly how do I use it my form\_for?

```
<%= i.select :year, (Date.today.year-1)..(Date.today.year+1), :selected => Date.today.year %>

```

Thanks in Advance.

Answer: 
You can use this 

```
<%= i.select :year, (Date.today.year-1)..(Date.today.year+1), :selected => Time.current.year %>

```
I think it should be:

```
<% year = Date.today.year %>
<%= i.select :year, options_for_selection((year-1)..(year+1), year)  %>

```

Hope this helps.