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 4612252
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:22:41+00:00 2026-05-22T01:22:41+00:00

Consider this as a challenge rather than its general approach. The reason I mention

  • 0

Consider this as a challenge rather than its general approach. The reason I mention this is because, it is generally preferred to incorporate admin-accessible features into the public facing site. This is what’s required:

  • Devise model for Users, visitors accessing the public facing site
  • Devise model for Admins
  • Namespace or scope the admin ‘area’ to /admin. Admins can only login from this route.
  • Users can sign up directly from the site’s public facing landing page; they are not forced to visit /users/sign_up as per the default devise generated route.
  • Consider overriding the default devise controllers

Thanks,
Mike.

  • 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-05-22T01:22:42+00:00Added an answer on May 22, 2026 at 1:22 am

    The following seems like I’ve made some progress in the right direction; this at least provides identical out-of-the-box devise functionality for both users and admins, with the custom routing,

      match 'admin', :controller => 'admin'
    
      namespace :admin do
        # to be updated later... 
      end
    
      devise_for :users
      #devise_for :admins, :path => "admin"  # this works but uses the default
                                             # Devise::SessionController
      devise_for :admins, 
        :controllers => { 
          :sessions => "admin/sessions", 
          :passwords => "admin/passwords",
          :registrations => "admin/registrations" }, :path => "admin",
        :skip => [:sessions, :passwords, :registrations] do
        get 'admin/sign_in' => 'admin/sessions#new', :as => :new_admin_session
        post 'admin/sign_in' => 'admin/sessions#create', :as => :admin_session
        get 'admin/sign_out' => 'admin/sessions#destroy', :as => :destroy_admin_session
    
        get 'admin/sign_up' => 'admin/registrations#new', :as => :new_admin_registration
        get 'admin/account' => 'admin/registrations#edit', :as => :edit_admin_registration
        post 'admin/account' => 'admin/registrations#create', :as => :admin_registration
        get 'admin/cancel' => 'admin/registrations#cancel', :as => :cancel_admin_registration
        put 'admin/account' => 'admin/registrations#update'
        delete 'admin/account' => 'admin/registrations#destroy'
    
        post 'admin/password' => 'admin/passwords#create', :as => :admin_password
        get 'admin/password/new' => 'admin/passwords#new', :as => :new_admin_password
        get 'admin/password/edit' => 'admin/passwords#edit', :as => :edit_admin_password    
        put 'admin/password' => 'admin/passwords#update'
      end
    

    Ideas?

    caveat: in this example, I’ve included the :registerable devise module in the Admin model just for testing during development. The sign_up route will, ultimately, be removed.

    Much searching yielded (mind the pun) the following blog post that seems to indicate overriding a devise controller requires the re-mapping of all its specified ‘HTTP verbs’ as it were; this makes sense as unmapped ones would be handled by the default devise controller.

    If anyone has more experience working with multiple devise models and the separated admin approach, I would be very much interested in your thoughts and suggestions!

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

Sidebar

Related Questions

Consider this (rather pointless) javascript code: function make_closure() { var x = 123, y
Consider this code: TimeStamp.Text = BlogComment.Date.UtcNow.ToString(yyyy-MM-ddTHH\:mm\:ss.fffffffzzz); BlogComment.Date is a DateTime object with its date
Consider this code: enum { ERR_START, ERR_CANNOTOPENFILE, ERR_CANNOTCONNECT, ERR_CANNOTCONNECTWITH, ERR_CANNOTGETHOSTNAME, ERR_CANNOTSEND, }; char* ERR_MESSAGE[]
Consider this contrived, trivial example: var foo = new byte[] {246, 127}; var bar
Consider this simple model: A base Location table: +-------------------------------+ | Locations | +-------------------------------+ |(PK)
Consider this template function: template<typename ReturnT> ReturnT foo(const std::function<ReturnT ()>& fun) { return fun();
consider this simple function def foo(l=[]): if not l: print List is empty else
Consider this small program: #include <stdio.h> #include <stdlib.h> // Change 60000 to 70000 and
Consider this code in a php file on my VPS server: <?php $url =
Consider this simple example - public class Person { private String name; private Date

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.