Class: ReviseAuth::PasswordResetsController

Inherits:
ReviseAuthController show all
Defined in:
app/controllers/revise_auth/password_resets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
# File 'app/controllers/revise_auth/password_resets_controller.rb', line 8

def create
  user = User.find_by(email: user_params[:email])
  user&.send_password_reset_instructions

  flash[:notice] = t(".password_reset_sent")
  redirect_to 
end

#editObject



16
17
# File 'app/controllers/revise_auth/password_resets_controller.rb', line 16

def edit
end

#newObject



4
5
6
# File 'app/controllers/revise_auth/password_resets_controller.rb', line 4

def new
  @user = User.new
end

#updateObject



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

def update
  if @user.update(password_params)
    flash[:notice] = t("revise_auth.password.update.password_changed")
    redirect_to 
  else
    render :edit, status: :unprocessable_entity
  end
end