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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:48:27+00:00 2026-06-12T20:48:27+00:00

I am working with RoR at the moment following some books and tutorials and

  • 0

I am working with RoR at the moment following some books and tutorials and it works quite well. But now I have to implement something for which I do not find any resource and I need a little help with that. Here’s what I want to do:
I have an application where people can log into and view things, so I have a database table called users, pretty self-explanatory. Additionally I have a table user_rights, each with an id, a name, and a description.
The idea is now, that each user can have multiple rights, giving him access to different parts of the application. Thus:

class User < ActiveRecord::Base
  attr_accessible :name, :password_digest, :password, :account_nr, :password_confirmation, :email
  has_many :scope
  validates :name, presence: true, uniqueness: true
  validates :account_nr, presence: true
  validates :email, :presence => true
  has_secure_password
end

and:

class Scope < ActiveRecord::Base
  attr_accessible :name, :description
end

I do not want to have a belongs_to-relationship. I just want a small table with user rights and give each user a couple of them. But unfortunately, I have absolutely no idea how to proceed! Could anyone give me some hints?

  • 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-12T20:48:28+00:00Added an answer on June 12, 2026 at 8:48 pm

    Seems like you need many-to-many association, like: user could have several rights and one right could be assigned to many users.

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

Sidebar

Related Questions

I've recently started working with RoR for some projects and I quite like the
i am just starting with RoR and working through some tutorials, there is however
I'm working on a RoR app, but this is a general question of strategy
I am a RoR developer, but I am presently working with CakePHP for a
Some time ago I managed to get RoR working on Windows XP. I've been
I am working on the depot tutorial in Agile RoR. I have looked at
I am working on a ROR application where I need to implement a crawler
I have been working for several months on a RoR project with fellows university
Working on a learning management system. NOT a RoR person. Have the line of
I have a RoR app that is working as expected when the server is

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.