Skip to content

Instantly share code, notes, and snippets.

@eileencodes
Created January 25, 2012 22:23
Show Gist options
  • Save eileencodes/1679246 to your computer and use it in GitHub Desktop.
Save eileencodes/1679246 to your computer and use it in GitHub Desktop.
class PasswordResetsController < ApplicationController
# create action for generate password token for forgot password
def create
user = User.find_by_email(params[:email])
if user
user.generate_password_reset if user
render :index
else
flash.now.alert = "No such email address was found. Please try again."
render :action => 'new'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment