RESTful habtm

Gregory Seidman
Sun, 13 Apr 2008 14:35:37 -0000

(Note: using Rails 2.0.2)

I have users and groups, with a habtm association, and I want to provide a
RESTful interface to adding and removing those associations. This is
independent from creating and deleting users or groups. It also isn''t
quite
as simple as treating the associations as resources, because I want to be
able to provide an interface to all of the following:

- add a user to a group
- remove a user from a group
- add a group to a user
- remove a group from a user
- set the list of users in a group
- set the list of groups a user is in

I believe this is a use case for nested resources, but I''m not clear on
how
to go about it either in terms of routing or in the controller.
Would someone explain how to go about it?

--Greg


--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---