Class: PasswordsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PasswordsController
- Defined in:
- app/controllers/passwords_controller.rb
Overview
Copyright © 2008-2013 Michael Dvorkin and contributors.
Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php
Instance Method Summary collapse
-
#create ⇒ Object
—————————————————————————-.
-
#edit ⇒ Object
—————————————————————————-.
-
#new ⇒ Object
—————————————————————————-.
-
#update ⇒ Object
—————————————————————————-.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/passwords_controller.rb', line 17 def create @user = User.find_by_email(params[:email]) if @user @user.deliver_password_reset_instructions! flash[:notice] = t(:msg_pwd_instructions_sent) redirect_to root_url else flash[:notice] = t(:msg_email_not_found) redirect_to :action => :new end end |
#edit ⇒ Object
30 31 32 |
# File 'app/controllers/passwords_controller.rb', line 30 def edit # <-- render edit.html.haml end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/passwords_controller.rb', line 12 def new # <-- render new.html.haml end |
#update ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/passwords_controller.rb', line 35 def update if empty_password? flash[:notice] = t(:msg_enter_new_password) render :edit elsif @user.update_attributes(params[:user]) flash[:notice] = t(:msg_password_updated) redirect_to profile_url else render :edit end end |