On 11/21/06, Cameron Booth
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hi there,
>
> I have a system with users who have groups of contacts (ie. other
> users). I''m trying to be as RESTful as possible, working on edge
rails,
> and using map.resources for as much as possible.
>
> The problem is that I have a form for the user to add a new contact.
> They can choose to put the contact in one of their existing groups, or
> they can create a new group at the same time.
>
> Pretty standard stuff, except I can''t figure out the way to do it
> RESTfully. It''s one submission from one form. If they''re
using an
> existing group, it''s fine, it''s just creating a contact,
and it makes
> sense to POST to the CREATE action in the CONTACTS_controller. However
> if I''m also creating a group, right now I have it set up to create
the
> group in the contacts_controller, though I feel like it should be in
> it''s own groups_controller
>
> Anybody have any suggestions, or encountered a similar issue?
You can just POST a contact and have the contact create also create a
group on-the-fly if necessary (i.e., if specified group doesn''t
exist), which sounds like what you''re doing. I don''t see
anything
wrong with that. You can of course also provide a RESTful
groups_controller to allow for POSTING of groups per-se, and there''s
nothing wrong with that.
--
Bosko Milekic <bosko.milekic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
http://www.crowdedweb.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---