Skip to content

Instantly share code, notes, and snippets.

@adahl
Created September 20, 2010 13:49
Show Gist options
  • Save adahl/587933 to your computer and use it in GitHub Desktop.
Save adahl/587933 to your computer and use it in GitHub Desktop.
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