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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:22:31+00:00 2026-06-02T22:22:31+00:00

I have the following resources setup: resources :sites do resources :documents # more nested

  • 0

I have the following resources setup:

resources :sites do
  resources :documents
  # more nested here
end


resources :documents do
  resources :notes, :except => [:show, :new, :edit]
end

I want the notes controller to have the document context. The problem is, the document controller itself depends on the site context. So the /document urls that are created from the above all throw a 500 error. I could adjust the controller code to handle this, but i wonder if there’s a way to not create the /document urls, just: /document/#id/notes

  • 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-02T22:22:33+00:00Added an answer on June 2, 2026 at 10:22 pm

    For any one else that may have this problem You can restrict the routes you don’t want by using :except just the way @agmcleod has for the :notes. So to restrict the document urls would either be:

    resources :sites do
        resources :documents, :except => [:index, :show, :new, :create, :edit, :update, :destroy]
        # more nested here
    end
    

    or

    resources :documents, :except => [:index, :show, :new, :create, :edit, :update, :destroy] do
        resource :notes, :except => [:show, :new, :edit]
    end
    

    You can remove any of the actions as necessary.

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

Sidebar

Related Questions

The Setup My setup is to have resources shared for two or more sites
The Setup My setup is to have resources shared for two or more sites
I have found the following resources on Balanced Matching for .net Regexes: http://weblogs.asp.net/whaggard/archive/2005/02/20/377025.aspx http://blogs.msdn.com/bclteam/archive/2005/03/15/396452.aspx
Lets say I have the following DataMapper resources: class Post include DataMapper::Resource has n,
I have following user control: <UserControl.Resources> <Style TargetType=HeaderedItemsControl> <Setter Property=Template> <Setter.Value> <ControlTemplate TargetType=HeaderedItemsControl> <Grid>
I have the following user control that is embedded within another user control. <UserControl.Resources>
I have the following ControlTemplate for a WPF TabItem: <ControlTemplate x:Key=DefaultTabItemTemplate TargetType={x:Type TabItem}> <ControlTemplate.Resources>
I have a form partial current setup like this to make new blog posts
I'm new to Maven and have skimmed over the documentation as I am following
I've got the following setup: map.resources :articles map.resources :users, :has_many => [:articles] Which 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.