Skip to content

Instantly share code, notes, and snippets.

@camfowler
Created January 16, 2014 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camfowler/8464475 to your computer and use it in GitHub Desktop.
Save camfowler/8464475 to your computer and use it in GitHub Desktop.
Generate reset token for devise. raw is the token used for the reset password url.
raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)
self.reset_password_token = enc
self.reset_password_sent_at = Time.now.utc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment