Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created May 12, 2015 09:25
Show Gist options
  • Save satomixx/ca3b6c099d89971a877a to your computer and use it in GitHub Desktop.
Save satomixx/ca3b6c099d89971a877a to your computer and use it in GitHub Desktop.
RailsでJSON API用のバックエンドを作っていたら、ActiveAdminが 401を吐いた場合 ref: http://qiita.com/tsumekoara/items/48f0b6d1230d5d704c06
Started GET "/admin" for ::1 at 2015-05-12 18:06:23 +0900
Processing by Admin::DashboardController#index as HTML
Completed 401 Unauthorized in 0ms
# ==> Navigation configuration
# Lists the formats that should be treated as navigational. Formats like
# :html, should redirect to the sign in page when the user does not have
# access, but formats like :xml or :json, should return 401.
#
# If you have any extra navigational formats, like :iphone or :mobile, you
# should add them to the navigational formats lists.
#
# The "*/*" below is required to match Internet Explorer requests.
config.navigational_formats = ['*/*', :json]
config.navigational_formats = ['*/*', :json, :html]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment