Questions tagged [nested-routes]

Nested routes allow to capture relationship in your routing.

http://guides.rubyonrails.org/routing.html#nested-resources

462 questions
36
votes
5 answers

Angular2 router: how to correctly load children modules with their own routing rules

here is my Angular2 app structure: Here is part of my code. The following is the main module of the Angular2 app, that imports its routing rules and a child module (EdgeModule) and uses some components related to some…
smartmouse
  • 13,912
  • 34
  • 100
  • 166
29
votes
4 answers

RESTful API routes design: nested vs. non-nested

My question is about the advantages of nesting resources when building URLs for API purposes. Consider the following two alternatives for accessing an employee resource: /api/employees?department=1 # flat Vs. /api/departments/1/employees #…
Ernesto
  • 3,837
  • 6
  • 35
  • 56
29
votes
5 answers

Rails 4 [Best practices] Nested resources and shallow: true

The following post is based on Rails 4. I am currently looking for a best-practice about the multiple nested resources (more than 1), and the option shallow: true. Initially in my routes, there was this : resources :projects do resources…
Erowlin
  • 9,555
  • 4
  • 35
  • 63
24
votes
6 answers

ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'ɵcmp' property

I get this error whenever the app is running, though is not causing me problems in current development (i think) I would like to understand this error and know where it comes, because I'm completely lost, I can't even post relevant code. But i'll…
Mellville
  • 1,027
  • 2
  • 18
  • 39
21
votes
2 answers

Using nested routes Rails 3 without actually allowing access to the parent resource

I'm using Rails 3 and I have two models EquipmentGroup and Reservation. I want reservations to be a nested resource of equipment groups so that I can access them with URLs like: /equipment_groups/:equipment_group_id/reservations/:id However, I…
Courtney
  • 231
  • 1
  • 6
21
votes
1 answer

Using nested resources without the parent ID in Rails

I have a class called Imprintables with nested resources Styles, Brands, Colors, and Sizes. I currently have this in my routes file: resources :imprintables do resources :styles, :brands, :colors resources :sizes do collection do post…
davidicus
  • 630
  • 1
  • 6
  • 16
15
votes
2 answers

Rails routing error with respond_with when creating nested resource

I'm having the following problem with a simple Rails 3 app I'm creating. It is driving me batty. My model: class Vehicle < ActiveRecord::Base has_many :vehicle_pictures, :dependent => :destroy def class VehiclePicture < ActiveRecord::Base …
orj
  • 13,234
  • 14
  • 63
  • 73
15
votes
3 answers

Ember.js How to get controller in needs which is nested controllerName

I want to use this.get('controllers.pack.query'); to get App.PackQueryController in App.PackController, but failed. I think the problem is Ember use pack not pack.query as controllerName when it tries to get the controller. Although I can get the…
Isaddo
  • 438
  • 4
  • 10
12
votes
1 answer

How to create routing inside a modal window [ ANGULAR 5 ]?

I have a requirement where i need to switch between 2 different views back and forth based on certain condition inside a modal window's body. Those 2 views are : List items (Initial view) Add new items After adding new items i need to switch to…
Neyo
  • 523
  • 1
  • 8
  • 23
11
votes
2 answers

Nested outlets in master layout outlet in angular 6

I am building an angular 6 application where I have two separate screens: Login (login, register, forgot password, profile) those pages are not part of the layout Layout (dashboard, products, invoices) those pages should share the same…
JustDontKnow
  • 321
  • 3
  • 13
11
votes
1 answer

Ember JS transition to nested routes where all routes are dynamic segments from a view

We are writing an application using EmberJS. However we are still new with this framework and we're having a hard time resolving some of what may seem to be straight forward. The model is pretty simple, there are 3 models: Queue, Task, and Image. We…
11
votes
1 answer

Nested resource and restricting the Routes Created :only and :except

Good day all, Can someone kindly assist me with nested resources and its best practice. I would like to restrict my :events route to only :show and :index, is this the correct way of doing it? resources :events do resources :registrations,…
9
votes
3 answers

Rails 3 - Nested resources and polymorphic paths: OK to two levels, but break at three

I'm trying to do a simple family reunion site with: "posts", "families", "kids", and "pictures". Ideally I'd like the routes/relationships to be structured this way: resources :posts do resources :pictures end resources :fams do …
9
votes
1 answer

Using nested router-outlets in angular 4

Im using multiple router-oulets to load my components. The outer router-outlet is used load most basic components like login, home, 404. I used nested router-outlet to load sub components of home page. That router-outlet is nested inside the…
LSampath
  • 138
  • 1
  • 3
  • 11
9
votes
1 answer

Django REST Permissions on Nested Routes

I am using the Django REST framework with the nested router extension. One of my routes looks like: companies/$company/locations/$location where $company and $location are slug variables. I want to allow users to POST to this URL:…
Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120
1
2 3
30 31