I have a collection_select dialog that I have for selecting Users on a
page. I am wanting the selection to remember and display the last
selected user from the database. Every time I refresh the page it is
going back to its default value even though the data has changed. Is
there a way to tell it to take the data that appears in the database
and not reset the selection tag like it a new value.
Here is my code that I'm using.
<% @users = User.list_all_testers %>
<%= collection_select(:machine, :user_id, @users, :id, :fullname,
options = {:include_blank=>true}, html_options = {:onChange =>
remote_function(:update => "ajaxmessage", :url => {:action =>
'update_machine_user',
:controller =>
'manage_machines',:id=>machine.id},:with=>"'users_id='+this.value")})
%>