lib/authenticated_system.rb
# Redirect as appropriate when an access request fails.
Redirect as appropriate when an access request fails.
Redirect as appropriate when an access request fails .
def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to new_session_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 new_session_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 .
# format.any doesn't work in rails version < http://dev.rubyonrails.org/changeset/8987 # you may want to change format.any to e.g. format.any(:js, :xml)