lib/authenticated_system.rb
def access_denied
    request.format = :html if request.env['HTTP_USER_AGENT'] =~ /msie/i

    respond_to do |format|
      format.html do
        store_return_to_location
        redirect_to main_app.root_path
      end
      format.any do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
# 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
    request.format = :html if request.env['HTTP_USER_AGENT'] =~ /msie/i
    respond_to do |format|
      format.html do
        store_return_to_location
        redirect_to main_app.root_path
      end
      format.any do
        request_http_basic_authentication 'Web Password'
      end
    end
  end
def access_denied request . format = :html if request . env [ 'HTTP_USER_AGENT' ] =~ / msie /i respond_to do | format | format . html do store_return_to_location redirect_to main_app . root_path end 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 .