Sha256: b86f809ac53e9bf7764822c6226560f86b3100b0eceb0ec5b38978b828502b41

Contents?: true

Size: 682 Bytes

Versions: 15

Compression:

Stored size: 682 Bytes

Contents

class UsersController < InheritedResources::Base
  respond_to :html, :js, :only=>[:edit, :show, :update]
  respond_to :json, :only=>[:verify_password]

  before_filter :authenticate_user!, :resource

  def edit
    respond_with(resource)
  end

  def update
    update! do |success, failure|
      failure.html{redirect_to "/change_password"}
      success.html{flash[:notice] = "Your password has been updated."; redirect_to root_url}
    end
  end

  def verify
    respond_with resource do |format|
      format.json {render :json=> resource.valid_password?(params[:password]).to_json}
    end
  end

  def resource
    @user ||= FullyValidatedUser.find(current_user)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
wheels-0.1.13 app/controllers/users_controller.rb
wheels-0.1.12 app/controllers/users_controller.rb
wheels-0.1.10 app/controllers/users_controller.rb
wheels-0.1.9 app/controllers/users_controller.rb
wheels-0.1.8 app/controllers/users_controller.rb
wheels-0.1.7 app/controllers/users_controller.rb
wheels-0.1.6 app/controllers/users_controller.rb
wheels-0.1.5 app/controllers/users_controller.rb
wheels-0.1.4 app/controllers/users_controller.rb
wheels-0.1.3 app/controllers/users_controller.rb
wheels-0.1.2 app/controllers/users_controller.rb
wheels-0.1.1 app/controllers/users_controller.rb
wheels-0.1.0 app/controllers/users_controller.rb
wheels-0.0.49 app/controllers/users_controller.rb
wheels-0.0.48 app/controllers/users_controller.rb