app/controllers/password_resets_controller.rb
#Find user by email, update reset attributes 
Find user by email, update reset attributes
Find user by email update reset attributes
def create
  	@user = User.find_by(email: params[:password_reset][:email].downcase)
  	if @user
  		@user.create_reset_digest
  		@user.send_password_reset_email
  		flash[:info] = "Email sent with password reset instructions"
  		redirect_to root_url
  	else
  		flash.now[:danger] = "Email address not found"
  		render 'new'
  	end
  end
def create @user = User . find_by ( email : params [ :password_reset ] [ :email ] . downcase ) if @user @user . create_reset_digest @user . send_password_reset_email flash [ :info ] = "Email sent with password reset instructions" redirect_to root_url else flash . now [ :danger ] = "Email address not found" render 'new' end end
Find user by email, update reset attributes
Find user by email update reset attributes