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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:21:19+00:00 2026-05-23T00:21:19+00:00

Objective: Be able to nest a resource, like records inside of users so that

  • 0

Objective:

Be able to nest a resource, like records inside of users so that I can access /users/1/records to see all of the first users records. But I would also like to see /records to see all of the records ( or the new ones, or something like that ).

Problem

So I know I am missing something somewhere because that cannot be the way to do it. I know I can have like a static page or some other route for that, but I don’t think that is very rails-y.

I would have users, so a user would see their page with their records, but also be able to browse records, so I assumed I would need a more general route for that.

Question

What is the appropriate way to browse a nested resource?

PS I have looked at things like this question, which almost address the problem, but deals with a static landing page for non logged in users, this is not what I am looking for.

  • 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-05-23T00:21:20+00:00Added an answer on May 23, 2026 at 12:21 am

    Not sure how to handle this route later in controllers (never tried), but something like this should work:

    resources :records
    
    resources :users do
      resources :records
    end
    

    I think you’ll need to do something in records’s index controller to check if its called for some user or not.

    UPD: Ok, checked it. Check for params[:user_id] in your index controller.

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

Sidebar

Related Questions

Objective-C is a language like Smalltalk, but weakly, dynamically typed language. And I can
Objective : Make a progress bar where users can check how much of a
Objective: I would like to be able to list the available COM Ports on
FYI I'm programming in objective-C but anyone might be able to help. I've been
I'm new to iPhone and Objective C programming but I'm able to make my
I'm writing a Cocoa application in Objective-C, and I would like to be able
Objective-C has no namespaces; it's much like C, everything is within one global namespace.
In Cocoa/ Objective C I need to be able to programmatically find out which
I'm new to Objective C and I haven't been able to find out if
I want my XCode Objective-C project to be able to detect which configuration it

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.