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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:35:35+00:00 2026-06-09T08:35:35+00:00

I am trying to solve an issue I’m having with setting up admin on

  • 0

I am trying to solve an issue I’m having with setting up admin on my site. Here is a simple version of my routes.

resources :users
  resources :articles
  resources :collaborators
end

resources :admin

Admin users are very similar to Collaborators, because they can edit and create Articles, but Admin has the ability to also c.r.u.d. Users, Collaborators, and Articles for every User. Collaborators can only c.r.u.d. Articles that are associated with the User they have been assigned to.

The part where this gets a little bit confusing is how to set up the controller and views that Admin uses for CRUD operations. As of now the way I am trying to implement it is to create separate CRUD views within admin/. The problem with this is that the functionality is so simimlar to a collaborator, I feel like it could be DRYer somehow.

Anybody know the most basic way to implement something like this? Thanks!

Update: I’d like to update this to say that it’s super easy to google admin tools for rails. I’m more wondering how to implement this without an admin tool, or if that sounds like a bad idea, why?

  • 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-09T08:35:36+00:00Added an answer on June 9, 2026 at 8:35 am

    The answer I came up with is to create Collaborators with an admin field true / false. I also set up CanCan and it’s working pretty nicely.

    Here is my CanCan ability.rb

    def initialize(user)

    if user.admin?
      can :manage, :all
    else 
      can :manage, Article, :id => user.article_id
      cannot :index, Article
    end
    

    end

    I just used “user” because it’s more readable and shorter than collaborator and basically a user…

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

Sidebar

Related Questions

im trying to solve this issue. I have a web site with this simplified
Been having major issues trying to solve this issue, I'll be happy to give
Trying to solve an issue for someone else and instead have run into my
I am trying to solve an issue when using a Castle ActiveRecord TransactionScope which
I'm trying to solve an issue where a script crashes with little-to-no error information
I'm trying to solve an issue with makefile. I have a main.cpp and then
I've been trying to solve this issue for a long time, and nothing seems
The issue I am trying to solve is that I have a folder with
I have been trying for hours to find a way to solve the issue,
I've got a mapping issue which I'm trying to solve in the mapping tool

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.