lib/authenticated_system.rb
# Redirect as appropriate when an access request fails.
#
# The default action is to redirect to the login screen.
#
# Override this method in your controllers if you want to have special
# behavior in case the user is not authorized
# to access the requested action.  For example, a popup window might
# simply close itself.
Redirect as appropriate when an access request fails.
The default action is to redirect to the login screen.

Override this method in your controllers if you want to have special
behavior in case the user is not authorized
to access the requested action.  For example, a popup window might
simply close itself.
Redirect as appropriate when an access request fails . The default action is to redirect to the login screen . Override this method in your controllers if you want to have special behavior in case the user is not authorized to access the requested action . For example a popup window might simply close itself .
def access_denied
      logger.debug("access_denied")
      respond_to do |format|
        format.html do
          if request.xhr?
          store_location
            render :inline => "<script>document.location.href = '<%=url_for(new_session_path)%>';</script>"
            return
          else
          store_location
          redirect_to new_session_path
        end
          end
        flash.now[:error] = "Access denied, you may need to log in."
        format.any do
          request_http_basic_authentication 'Web Password'
        end
      end
    end
def access_denied logger . debug ( "access_denied" ) respond_to do | format | format . html do if request . xhr? store_location render :inline => "<script>document.location.href = '<%=url_for(new_session_path)%>';</script>" return else store_location redirect_to new_session_path end end flash . now [ :error ] = "Access denied, you may need to log in." format . any do request_http_basic_authentication 'Web Password' end end end
Redirect as appropriate when an access request fails.
Redirect as appropriate when an access request fails .
#send a javascript-based redirect