Moving positions between lists with ajax

I want to put two lists on one page: list of users (not belong to group)
and list of group users (users which are belong to group).
I want to move users between this two lists with ajax, but save changes
at the end - when all users which I want will be moved.
Moving with ajax is easy but it works only with one step. Every time I
have to take list: @users and @group_users from database so I lose
change from last step.
I'm not sure it's clear...
But my question is: can I remember object (collection) between actions
(not using cookies and session)?
Or mabye someone knows, where can I find some example how to do lists as
I described?
Thanks for help.

Have a look at the code here:

It's not *exactly* what you're after, but I suspect you can use the same
psuedo-attribute/mass-assignment approach to create a form that will let
your user build up a list of people all in client-side script & submit
them all in one batch at the end.

You may want to actually watch railscasts 73, 74 & 75 before trying to
understand that code, just for context. I found that code fairly
mind-blowing, myself (tho I'm a newbie).