http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M001753

I assume you have the Ajax and the update parts right.  It is a
question of populating the right value into @machine.

On Sep 9, 2:03 am, Will <[EMAIL PROTECTED]> wrote:
> 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")})
> %>
>
> Thanks William
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to