I have a search form in my navbar where a user can select in which area he wants to search. After clicking the submit-button the results get rendered but the previous selected area is no longer selected.
<%= form.select (:suchfeld, [ ['Beschreibungen','description'], ['Headlines','headline']] ) %>
I was able to re-fill the search-field wich the previous content doing the following:
<%= form.text_field :suche, :name => "suche", :size => 25, :value => params[:suche].gsub(' ','') %>
But how can I automatically add "selected" to a select-field to select the last selected item?
Thanx