def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to login_path
        end
        format.any do
          request_http_basic_authentication 'Web Password'
        end
      end
    end
def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to login_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 account is not authorized
 to access the requested action.  For example, a popup window might
 simply close itself.