Class: Clearance::PasswordsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
# File 'app/controllers/clearance/passwords_controller.rb', line 9

def create
  if user = find_user_for_create
    user.forgot_password!
    deliver_email(user)
  end
  render template: 'passwords/create'
end

#editObject



17
18
19
20
# File 'app/controllers/clearance/passwords_controller.rb', line 17

def edit
  @user = find_user_for_edit
  render template: 'passwords/edit'
end

#newObject



22
23
24
# File 'app/controllers/clearance/passwords_controller.rb', line 22

def new
  render template: 'passwords/new'
end

#updateObject



26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/clearance/passwords_controller.rb', line 26

def update
  @user = find_user_for_update

  if @user.update_password password_reset_params
     @user
    redirect_to url_after_update
  else
    flash_failure_after_update
    render template: 'passwords/edit'
  end
end