app/controllers/password_resets_controller.rb
# The create action for a password reset
The create action for a password reset
The create action for a password reset
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] = "Check your email for the password reset link"
      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 ] = "Check your email for the password reset link" redirect_to root_url else flash . now [ :danger ] = "Email address not found" render 'new' end end
The create action for a password reset
The create action for a password reset