The Teams component comes with a built-in invitations system, which gives your Rails application:
Users can navigate to their account's settings > Team Members list > Invite a new member.
Here, the user sees a form where they can compose a custom message and send the invitation. This does the following:
Invitation
recordAfter an invitation has been created, it's listed in the invitations index view.
Users can see an invitation's status ("pending" or "accepted"), and they can re-send the invitation mailer, or edit the invitation mailer message before re-sending.
Users can also cancel the invitation, which will prevent the invited user from accepting the invitation (if they haven't already).
When an invited user receives the invitation mailer, they can click the link in the mailer to accept the invitation.
This takes the user to the invitations/accept_invitation
view, where they see the name of the account they've been invited to, and can proceed to create their password and register as a user. This does the following:
User
recordAccountUser
record, associated with the Account
they've been invited to
role
set to whatever the role the invitation
record dictatesInvitation
record's status
to "accepted"I created Instrumental Components to make designing and building professional apps with Ruby on Rails easy, fast, and fun. I use it on all of my projects and I hope it helps you build something great.