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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:26:31+00:00 2026-06-15T11:26:31+00:00

I am working on a ruby on rails application with many types of users.

  • 0

I am working on a ruby on rails application with many types of users. All users will share the basic properties of email address and password, along with the timestamp fields for created_at and updated_at. Other fields will be unique to the type of user (think Employee, Vendor, Manager, etc.) I have been looking into Single-Table Inheritance but that does not seem like the right pattern for this. The other option seems to be to have a User model that has_one of the other models. It is also possible for a User to have multiple types, ie. Employee and Manager could be the same User. I also want to direct the user to a specific page on login, based on what type of user they are. Would this be best done through constraints in the router or a large switch statement on login?

  • 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-15T11:26:32+00:00Added an answer on June 15, 2026 at 11:26 am

    You probably need to define user roles. I suggest CanCan to manage your roles and access privileges.

    One way to to implement different fields on a single table would be to use NoSQL (hstore) from Postgres. This is a simple introductory tutorial.

    Here is and example of using it with Rails 3.2+

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

Sidebar

Related Questions

Greetings, all, I'm working on an application in Ruby on Rails where we need
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
I am working on Ruby on Rails application, with Prototype. I want to display
I'm working on Ruby on Rails 3 application. Already, I have implemented authentication and
I am working on a ruby on rails application. For a session controller, I
I'm working on a Ruby on Rails application that used the Devise authentication system.
I am working on a web application that will deal with many image uploads.
I just working on a simple Ruby on Rails application that keeps the data
I am working on a Ruby on Rails 3 web application and am not
I am a complete newbie in working with a Ruby on Rails (RoR) application.

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.