Class: PasswordsController

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

Instance Attribute Summary

Attributes included from Authentication

#current_user

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
# File 'app/controllers/passwords_controller.rb', line 5

def create
  if (user = User.find_by(email_address: params[:email_address]))
    PasswordsMailer.reset(user).deliver_later
  end

  ok
end

#updateObject



13
14
15
16
17
18
19
20
# File 'app/controllers/passwords_controller.rb', line 13

def update
  if @user.update(params.require(:user).permit(:password, :password_confirmation))

    ok
  else
    head :not_acceptable
  end
end