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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:32:22+00:00 2026-06-09T05:32:22+00:00

I am using Rails 3 with the CanCan gem. The models Users and Networks

  • 0

I am using Rails 3 with the CanCan gem. The models Users and Networks are a has_many :through => Roles. This part works fine.

Currently I am using CanCan so that on the /networks page it will only display a network if a users has access to it. This also works fine.

I know that CanCan can be combined with nested resources, but is having a route for /users/1/networks redundant? optional? Encouraged? RESTful? Rails-y? Is there any specific reason to have it? I only want users to be able to see networks they have access to, but wasn’t sure if nested resources was the more proper way to go if I already have the Network index acting as a filter.

  • 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-09T05:32:23+00:00Added an answer on June 9, 2026 at 5:32 am

    To me, the route should make sense in the context of the people using your application. If you’re logged in as an admin that can CRUD routes I would want this done through /networks because all things you’re doing related to routes will occur here.

    /networks            #list all networks
    /networks/new        #add network
    /networks/1          #show network
    /networks/1/edit     #edit network
    

    From a user perspective, however, it makes sense for them to be able to add/remove them self to a new network or view the network they’re in.

    /users/1/networks         #show networks user is in
    /users/1/networks/add     #add self to network
    /users/1/networks/delete  #remove self from network
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using rails 3 with cancan gem.And now i am trying to implement
I'm using Rails 3.0.10 and I'm currently using CanCan for determining the different abilities
Using Rails 3.2 and ruby 1.9.3p0 I am trying out the gem delayed_job. I
Note: Using Rails 3.1 and current delayed_job gem. I have a User model that
Using Rails 3.1.3 with Devise 1.5.3. My app has accounts and users. Each account
I'm trying to get some basic authentication/authorization with devise/cancan with Rails. Rather than using
I'm using Mongoid, Devise and Rails 3.1. I have four models: Students, Teacher, Parents
Using Rails 3.1.3. I have Accounts and Users. One Account can have many Users.
I am used to using cancan in my rails views to show/hide visual elements
I'm using devise and cancan in a Rails 3.2 project. I have an event

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.