Class: ActiveAuthentication::PasswordsController

Inherits:
ActiveAuthenticationController show all
Defined in:
app/controllers/active_authentication/passwords_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
# File 'app/controllers/active_authentication/passwords_controller.rb', line 8

def create
  @user = User.find_by email: params[:email]
  @user&.send_password_reset_instructions
  redirect_to root_url, notice: t(".success")
end

#editObject



14
15
# File 'app/controllers/active_authentication/passwords_controller.rb', line 14

def edit
end

#newObject



5
6
# File 'app/controllers/active_authentication/passwords_controller.rb', line 5

def new
end

#updateObject



17
18
19
20
21
22
23
24
# File 'app/controllers/active_authentication/passwords_controller.rb', line 17

def update
  if @user.update(user_params)
     @user
    redirect_to root_url, notice: t(".success")
  else
    render :edit, status: :unprocessable_entity
  end
end