Class: PasswordsController

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

Constant Summary collapse

ACTION_TOKEN_PURPOSES =
ActiveSupport::HashWithIndifferentAccess.new(
  new:    :account_setup,
  create: :account_setup,
  edit:   :password_reset,
  update: :password_reset
).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



11
12
13
# File 'app/controllers/passwords_controller.rb', line 11

def user
  @user
end

Instance Method Details

#createObject

Sets user password



24
25
26
# File 'app/controllers/passwords_controller.rb', line 24

def create
  update_password(:new)
end

#editObject

Update password form



29
30
31
# File 'app/controllers/passwords_controller.rb', line 29

def edit
  # edit.html.erb
end

#newObject

Set password form



19
20
21
# File 'app/controllers/passwords_controller.rb', line 19

def new
  # new.html.erb
end

#updateObject

Resets user password



34
35
36
# File 'app/controllers/passwords_controller.rb', line 34

def update
  update_password(:new)
end