I am trying to implement both devise_token_auth and Active Admin in my rails api back-end.
There are pretty clear instructions on the devise_token_auth FAQ explaining how to implement the two together - it requires two different Application Controller classes.
# app/controllers/api_controller.rb
# API routes extend from this controller
class ApiController < ActionController::Base
include DeviseTokenAuth::Concerns::SetUserByToken
end
# app/controllers/application_controller.rb
# leave this for ActiveAdmin, and any other non-api routes
class ApplicationController < ActionController::Base
end
I have both of these controllers in my app, but I can't figure out how to inherit from them for the controllers for Active Admin and devise_token_auth.
I'm sure I am missing something basic here, because in all of the answers that I've seen about this on StackOverflow, it seems assumed that I know how to do this.
Can anyone help?
Edit:
Restating the problem, because I don't think I was clear the first time. Right now, both Active Admin and devise_token_auth are using the ApplicationController, even though I created the ApiController too. How do I make devise_token_auth use the ApiController?