Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8161289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:28:03+00:00 2026-06-06T18:28:03+00:00

I have been using devise for authentication and cancan for authorization in my application.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:28:05+00:00Added an answer on June 6, 2026 at 6:28 pm

    If you already have the users table created, so you should skip the creation of this table.

    Running:

    rails generate active_admin:install --skip-users
    

    And don’t forget to run:

    bundle exec rake db:migrate
    

    Be attempt to change the authentication method on the config/initializers/active_admin.rb file. Also make sure you have the current_admin_user method created, if you don’t, you can just modify it to the devise defaults (current_user method).

    You will have to modify the http method used in the logout link to :delete.

    config.logout_link_method = :delete
    

    And the route path to the logout action.

    config.logout_link_path = :destroy_user_session_path
    

    For better understand the authenticate method, I’m pasting my app/controllers/application_controller.rb relevant code:

    class ApplicationController < ActionController::Base
      protect_from_forgery
    
      #
      # redirect registered users to a profile page
      # of to the admin dashboard if the user is an administrator
      #
      def after_sign_in_path_for(resource)
        resource.role == 'admin' ? admin_dashboard_path : user_path(resource)
      end
    
      def authenticate_admin_user!
        raise SecurityError unless current_user.try(:role) == 'admin'
      end
    
      rescue_from SecurityError do |exception|
        redirect_to root_path
      end
    end
    

    Hope it helps you and maybe someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using 9 patch images for a while now. But have come
I have been using the storyboard to make an application and currently there are
I have been using CI just fine using the MySQL driver. I want to
I have been using waveInGetDevCaps to get the name of waveIn devices, but the
I am writing a very performance intense program and have been using C, but
I am using Ruby on Rails and devise for authentication. I have a user(customer)
I use Devise (1.4.8) for my User model and have been trying to implement
I have been using PhoneGap 1.0 for a long time now and it works
I have been using TortoiseSVN for some time and I really like it. I
I have been using Stanford POS Tagger to tag parts of speech in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.