For the code given below I wanted to keep the select box selected with the value that is passed.
But this doesn’t work:
@yrs =[2011,2010,2009,2008] &
<%= select_tag "page_type", options_for_select(@page_type.collect{ |u| [u.data_name, u.id]}, :selected=>@page.page_type), {:class =>"select_combobox",:onchange=>"reset_form(this.id,'page_type_msg');"} %>
this works for me :)