-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with ActiveAdmin #156
Comments
What do your routes look like? Also, please take a look at the issue reporting guidelines. |
version: 0.1.32.beta5 Routes: devise_for :admin_users, ActiveAdmin::Devise.config namespace :api, defaults: { format: :json } do Stacktrace: |
Seems to interfere with the normal devise setup I have for the users resource despite the namespacing I followed from the FAQ section in the read me. |
Are you including the # app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
include DeviseTokenAuth::Concerns::SetUserByToken
end |
Yes. I believe the resource_class method is the problem. I haven't gotten too far but I believe there is a similar method used by ActiveAdmin or ActiveSupport that doesn't require any parameters. |
I think ActiveAdmin may extend from your |
Yup. That fixes it. Of course now the token auth doesn't. :) |
So you will need to create another base controller for your API routes. Something like this: # 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 don't know why ActiveAdmin has anything to do with your main ApplicationController. It seems like a poor design choice on their part. |
Actually its the inherited_resources dependency in ActiveAdmin that inherits from the ApplicationController. |
Thanks for the update. I will try the workaround. |
Add FAQ item for use with ActiveAdmin. References #156
@bluengreen - thanks for closing this one out. I just added a note in the README regarding this issue, let me know if there's anything else I should add. |
It seems this gem is not compatible with activeadmin. It clobbers the routes that activeadmin generates with devise. devise_token_auth always takes over and causes a 500 error. Regardless of the namspacing and scoping I give the devise_token_auth gem.
The text was updated successfully, but these errors were encountered: