Created
September 20, 2010 13:49
-
-
Save adahl/587933 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
---- | |
InvitesController | |
def new | |
- show invite form | |
end | |
def create | |
- create new record with email and md5 of email + any additional info | |
- send email with registration link that includes md5 of email | |
end | |
2. | |
---- | |
User clicks link to Devise sign_up page: | |
mydomain.com/users/sign_up?invite=<md5> | |
Devise RegistrationsController is extended: | |
class Users::RegistrationsController < Devise::RegistrationsController | |
def new | |
- Check for valid md5 and retrieve record | |
- Prefil user object with info from invite object | |
end | |
def create | |
- Check for valid md5 and retrieve record | |
- Save user | |
- Do anything else that needs to be done with any additional info (create permissions, etc.) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment