2

I've created a new rails-api 4.2.1 project and try to make ActiveAdmin working with it.

I see that admin_user is authorized but after redirect to a dashboard 401 is returned ...

Benjamin Harel
  • 2,906
  • 3
  • 24
  • 32
  • 1
    Instead of disabling `api_only` mode altogether (which kind of defeats the purpose of creating an API app in the first place), you can selectively add middleware that allows ActiveAdmin to work while keeping your API controllers using the slimmed-down stack. [Here is a guide](http://www.carlosramireziii.com/how-to-add-active-admin-to-a-rails-5-api-application.html?utm_source=stackoverflow) to **enable ActiveAdmin to work with a Rails 5 API application**. Not sure if it works exactly the same for `rails-api` 4.x, but it may be similar. Hope that helps! – Carlos Ramirez III Jan 29 '17 at 16:22

1 Answers1

1

Adding

config.api_only = false

to application.rb solved the issue.

from here

Community
  • 1
  • 1
Benjamin Harel
  • 2,906
  • 3
  • 24
  • 32