This commit is contained in:
Micha Wrobel 2012-03-04 15:54:25 +01:00
parent 5d52be2bae
commit ea62987c06

View File

@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base
class Unauthorized < Exception; end class Unauthorized < Exception; end
class Forbiden < Exception; end class Forbiden < Exception; end
rescue_from Unauthorized, :with => :unathorized rescue_from Unauthorized, :with => :unauthorized
rescue_from Forbiden, :with => :forbiden rescue_from Forbiden, :with => :forbiden
helper_method :current_user helper_method :current_user
@ -40,7 +40,7 @@ class ApplicationController < ActionController::Base
end end
end end
def unathorized def unauthorized
if request.xhr? if request.xhr?
render :json => "Unauthorized", :status => 401 render :json => "Unauthorized", :status => 401
else else