Class: Clearance::PasswordsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Clearance::PasswordsController
- Defined in:
- app/controllers/clearance/passwords_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/clearance/passwords_controller.rb', line 12 def create if user = Clearance.configuration.user_model.find_by_email( params[:password][:email]) user.forgot_password! ::ClearanceMailer.change_password(user).deliver render :template => 'passwords/create' else flash_failure_after_create render :template => 'passwords/new' end end |
#edit ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/clearance/passwords_controller.rb', line 24 def edit @user = Clearance.configuration.user_model.find_by_id_and_confirmation_token( params[:user_id], params[:token].to_s) render :template => 'passwords/edit' end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/clearance/passwords_controller.rb', line 8 def new render :template => 'passwords/new' end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/clearance/passwords_controller.rb', line 30 def update @user = Clearance.configuration.user_model.find_by_id_and_confirmation_token( params[:user_id], params[:token].to_s) if @user.update_password(params[:user][:password]) sign_in(@user) redirect_to(url_after_update) else flash_failure_after_update render :template => 'passwords/edit' end end |