Problem inserting parameters in link_to_remote

I want a page that lets users add members to a group
from a longer list, or remove members from that group.
I can use Ajax to transfer a name from the long list
to the group, or drop an existing name from the group.


If I add a person to the group, and try to remove
without refresh, it doesn’t work. My link is formed
by <%= link_to_remote ‘add’, :url => { :action =>
“remove_member”, :id =>, :group_id =>"} %> For a member who’s in the group when I
reach the page, that generates a call to
as it should. But if I add a member ‘foo’ to the
group and then try to remove the same person, the call
is controller/remove_member/

I’ve been able to hack around it by setting :id =>
“#{}.{}” in the link_to_remote, but
there’s got to be a better way.

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

What you really want to do is read and apply the ideas in this post: (straight from the
source). Then read: Your exact
scenario is shown on page 21. RESTful rocks!

Hope this helps,