I have a drop down in my forms.
Year Manufactured The value needs to be from 1970 -- current year
In the new form i am using the following code
<select name="vehicle[year_made]" id="vehicle_year_made">
<option value="0" selected="selected">-- Select --</option>
<%= options_from_collection_for_select((1970..Time.now.year).collect
{|p| [ p, p ] }, "first", "last") %>
</select>
I want to be able to show the items in reverse order. Where the most
recent year shows first.
Also in the edit form i want similar code but with the selected item to
be the one that is present in the database. How can i achieve this?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---