I am trying to strictly adhere to REST and I have a few code
My database tables are as follows:
The relationships are as follows:
GROUPS have many USERS and USERS have many GROUPS.
EVENTS have many USERS and USERS have many EVENTS.
So, right now, I have a controller for users, groups and events. I got
to the point where I want to have USERS add themselves to a GROUP and/or
an EVENT. Before I add methods to the group or event controller
specifically that are called something like add_user, delete_user,
edit_user … I want to get everyones take on my problem.
Here is my question:
Should I either (a) create a new controller for GROUP_USERS and
EVENT_USERS that handles the GROUP/USER and EVENT/USER relationships
Should I (b) reuse the user controller code and in “def create” check to
see if there is an event_id or group_id present and then add the user to
either the group or event there?
Or, I guess, is there a better way to handle this?
Thanks a ton in advance,