I m using this code to display a drop down list. But when I select value and reload it, I want to display the selected values.
<%= collection_select("server", "id",@ndt,"ndname", "ndname",:prompt => "Select Server") %>
Like in textbox
<%= text_field_tag :name, params[:name]%>
On reloading,it displays the name in text box which we entered. Is there same thing for collection_tag?
Use the
:selectedoption.