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

  • SEARCH
  • Home
  • 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 8451327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:12:34+00:00 2026-06-10T11:12:34+00:00

We have admin_users and we have regular users and they both have separate tables,

  • 0

We have admin_users and we have regular users and they both have separate tables, models and devise logins.

It might make more sense to use devise against just one user table and use cancan for the roles but the application has already been created with two separate user tables and it’s not an option to change them at this point.

The admin users functionality, including login, is working ok.
Initially standard users access was only through a link and token based authentication but that needs to change.

In routes we had

devise_for :admin_users, ActiveAdmin::Devise.config  
devise_for :users
resources :users, :only => [:update, :edit]

So I added the root path for the users resource as indcated by the Devise documentation as the place where a successful login goes to:

devise_for :admin_users, ActiveAdmin::Devise.config  
devise_for :users
resources :users, :only => [:update, :edit] do
  root to: "practitioner_activities#welcome"
end  

and I then also tried removing the only => e.g.

devise_for :admin_users, ActiveAdmin::Devise.config  
devise_for :users
resources :users do
  root to: "practitioner_activities#welcome"
end  

For the (regular) User model I changed:

devise :token_authenticatable,

to also have:

devise :token_authenticatable, # token login still permitted.  
       :database_authenticatable, :recoverable, :rememberable, 
       :trackable, :validatable
       # Not sure if these will make a difference but they are like this in other apps.

but instead of redirecting to practitioner_activities#welcome the users gets sent back to the login screen.

I notice that the first line in the console that is logged for the login POST is using the AdminUser model, not the User model. Any idea how to fix?

Started POST "/" for 127.0.0.1 at 2012-08-23 13:54:50 -0400
Processing by HelpController#show as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"28iGxAB+URoIKoBQtPizGAosJoZ/V7Vko1w/bYMvesE=", "new_user_session_path"=>{"email"=>"Borger.Cathy@meridianschools.o
rg", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign In"}
  AdminUser Load (0.4ms)  SELECT "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = 1 LIMIT 1

The login form itself is:

= semantic_form_for(:new_user_session_path, 
  :html => {:id => "session_new"}) do|f| 

      = f.inputs do
        = f.input :email, :label => "Username"
        = f.input :password
        = f.input :remember_me, :as => :boolean, :if =>  false  
        = f.commit_button "Sign In"
  • 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-10T11:12:35+00:00Added an answer on June 10, 2026 at 11:12 am

    In the end the main things was to just the devise generators again and then edit the devise views.

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

Sidebar

Related Questions

I have a New user form both for admins and for regular users. Both
I have two models User and Admin(with RailsAdmin) that use Devise. I sign in
In my ASP.NET MVC 3 application i have two types of users - regular
I am building an app that has two types of users: regular users (have
So I have 3 types of users: admin moderator regular user I have the
I have an admin form that lets users create entities that require an image.
Hi Sitepoint wizard people, Say we have an admin application that has multiple users
I have a set of checkboxes that an Admin can tick to give users
Let's say I have a site where Users can add Entries through admin panel.
Using Rails 3.1.3 with Devise 1.5.3. My app has accounts and users. Each account

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.