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.
But.
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 => person.id, :group_id =>
group.id"} %> For a member who’s in the group when I
reach the page, that generates a call to
/controller/remove_member/person.id?group_id=group.id
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/foo.id.
I’ve been able to hack around it by setting :id =>
“#{person.id}.{group.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