Class: UsersController
- Inherits:
-
InheritedResources::Base
- Object
- InheritedResources::Base
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
7 8 9 |
# File 'app/controllers/users_controller.rb', line 7 def edit respond_with(resource) end |
#resource ⇒ Object
33 34 35 |
# File 'app/controllers/users_controller.rb', line 33 def resource @user ||= FullyValidatedUser.find(current_user) end |
#update ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/users_controller.rb', line 11 def update if params[:commit] == "Update Account" @user = User.find(params[:id]) update! do |success, failure| failure.html{redirect_to my_account_path} success.html{flash[:notice] = "Your account has been updated."; redirect_to root_url} end else @user = User.find(params[:id]) @user.password = params[:user]["password"] @user.save flash[:notice] = "Your password has been changed." redirect_to root_url end end |
#verify ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/users_controller.rb', line 27 def verify respond_with resource do |format| format.json {render :json=> resource.valid_password?(params[:password]).to_json} end end |