I have been using devise for authentication and cancan for authorization in my application. The application worked fine with them. But now i wanted to use active admin to manage all the users that are already in my application that are being used by devise and cancan. Active admin creates its own admin_users table for the users. how can i make active_admin use the users and roles table that was previously in use? thanx for your help.
I have been using devise for authentication and cancan for authorization in my application.
Share
If you already have the
userstable created, so you should skip the creation of this table.Running:
And don’t forget to run:
Be attempt to change the authentication method on the
config/initializers/active_admin.rbfile. Also make sure you have thecurrent_admin_usermethod created, if you don’t, you can just modify it to the devise defaults (current_usermethod).You will have to modify the http method used in the logout link to
:delete.And the route path to the logout action.
For better understand the authenticate method, I’m pasting my
app/controllers/application_controller.rbrelevant code:Hope it helps you and maybe someone else.