I am building a rails app which has projects which users (handles by Devise) can be invited to as collaborators (much like GitHub repositories and collaborators). I am struggling getting the invitations running (removing collaborators specifically). I have been following this tutorial to get the creation of invitations running but the tutorial does not cover revoking the invitations (removing collaborators).
I have a projects_controller.rb
file and an invites_controller.rb
file. The invites controller handles the creation of new invitations, which is working fine (i.e: if a user already exists, they are immediately added to a project, if a user doesn't exist, an invitation is sent to the entered email address).
How should I go about adding functionality for removing collaborators? To me, it would seam logical to use an invites#destroy
(being that invitations are created in that controller) but then, simply deleting an invite will not revoke the user's permission to a project. And what about the users who create a project initially, they will not have an invitation at all..
Does anyone know which path I should take here? Let me know if any more information would be helpful.
Thanks