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