Forum: Ruby on Rails Proper way to manage a collection of existing objects

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5783dc2fb306ee1f34d53b92d2533fac?d=identicon&s=25 Michael Carland (mcarland)
on 2008-12-26 04:01
Hello,

I've been looking for a pattern to implement managing a collection of
exiting objects, and haven't had much luck.

For example, if I have REST controllers for users, and for groups, what
would be a good way to implements the assignment of users to groups,
where the group was already selected? Would it be to add the
functionality to the existing group controller? Create a new controller
to manage the association of the two?

I've seen plenty of examples of writing RESTfull controllers for
individual models, and examples handling the creation of new dependent
models (blog posts with new comments), but I haven't been able to find
examples of more complicated interactions. Does anyone know of a good
reference?

Thanks.

-Michael
This topic is locked and can not be replied to.