I want to have a drop down that consists of values 10% 20% 30% so on till 100.
In ruby It can be done by
(10..100).step(10) { |i| p i }
If you landed here, like me, without the need to use step()
or to provide a formatted value (e.g. "20%"), this is a nice and succinct method:
<%= f.select :year, (2011..Date.today.year).to_a %>
With a Default
<%= f.select :year, options_for_select( (2011..Date.today.year).to_a, Date.today.year ) %>