I've been searching stackoverflow for almost 2 hours now going through similar questions but the answers just don't seem to work.
I have the following code:
<%= select_tag "name_dropdown", options_from_collection_for_select(@models, "friendly_id", "name") %>
I'd like to display the option I've chosen previously as selected instead of going to the first tag by default.
In the other questions they've suggested to add the following (none of them work).
<%= select_tag "name_dropdown", options_from_collection_for_select(@models, "friendly_id", "name", "1") %>
Or:
<%= select_tag "name_dropdown", options_from_collection_for_select(@models, "friendly_id", "name", @models.first.id) %>
ps. I'm using Rails 3.1.RC4