Class: PasswordResetsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/password_resets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Send a password update link to users with a verified email



17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/password_resets_controller.rb', line 17

def create
  if email_valid?
    send_update_password_email(user)

    # Always display notice to prevent leaking user emails
    redirect_to new_session_path, notice: t(".notice", email:)
  else
    flash.now.alert = t(".alert")
    render :new, status: :unprocessable_content
  end
end

#newObject

Password reset request form



12
13
14
# File 'app/controllers/password_resets_controller.rb', line 12

def new
  # new.html.erb
end