Class: Clearance::PasswordsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#show

Methods included from Authorization

#authorize, #deny_access

Methods included from Authentication

#authenticate, #current_user, #current_user=, #handle_unverified_request, #sign_in, #sign_out, #signed_in?, #signed_out?

Instance Method Details

#createObject



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

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

#editObject



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

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

#newObject



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

def new
  render :template => 'passwords/new'
end

#updateObject



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

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