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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:17:47+00:00 2026-06-16T11:17:47+00:00

I’m using rails 3.2 and devise 2.1 to create a multi-site CMS Requirements Sites

  • 0

I’m using rails 3.2 and devise 2.1 to create a multi-site CMS

Requirements

  • Sites based Basecamp subdomains.
  • Have 3 “user” models. 1. Admin(superuser) 2. Authors(each have their own site on subdomain) & Subscribers(read the sites ).
  • Authors: registration is normal username/password combo but needs to be approved by admin. their registration form will have subdomain field.
  • Subscribers: registration happens by invitation email.
  • need separate login & registration forms

Possible Solutions

I have been searching & found few solutions

  • 3 Separate models in devise:
$ rails generate devise admin 
$ rails generate devise author
$ rails generate devise subscriber

but this gives the following error

$ rails generate devise author
/home/gaurish/.rvm/gems/ruby-1.9.3-p286-perf/gems/devise-2.1.2/lib/devise/rails/routes.rb:443:in 'raise_no_devise_method_error!': Admin does not respond to 'devise' method. This usually means you haven't loaded your ORM file or it's being loaded too late. To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb' or before your application definition in 'config/application.rb' (RuntimeError)

  • STI: single table in the database and for each user type create a model

     class Admin < User; end
     class Author < User; end
     class Subscriber < User; end

Here, I am not sure how this would handle different login/registration workflows. example for subscriber I am planning on using devise_invitable for creating invitations. Admin doesn't need to scoped on basis of subdomains unlike authors & subscribers.

Does this seem complicated? I hope I was able to explain well.

  • 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-16T11:17:50+00:00Added an answer on June 16, 2026 at 11:17 am

    You don’t need to have three separate models to build this functionality. What you want to look at is the concept of Roles which are applied to one User model.

    There is a Gem which provides this capability called Rolify and can be found at https://github.com/EppO/rolify

    This would allow you to specify which users are in which Roles and change them as you see fit, all from one existing model.

    Once you have Roles attached to the User model, you can override Devise’s registration controllers to detect the Role and render different templates etc. You would do this by:

    1. Running rails generate devise:views to unpack the views from the Devise gem into your project
    2. Create your own Registrations controller:

      # app/controllers/registrations_controller.rb
      class RegistrationsController < Devise::RegistrationsController
        def new
          super
          # Add logic here to detect Role and display different forms
        end
      
        def create
          super
        end
      
        def update
          super
        end
      end 
      
    3. Add the correct settings in your routes.rb file to tell Devise to use your new controller:

      # app/config/routes.rb
      devise_for :users, :controllers => {:registrations => "registrations"}
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.