Nested routes allow to capture relationship in your routing.
Questions tagged [nested-routes]
462 questions
0
votes
1 answer
Rails Routes - How to get nested IDs from URI Pattern
In my router I have nested two ressources:
resources :servers do
member do
resources :maintenances
end
end
which results in URI pattern as follows:
maintenance GET /servers/:id/maintenances/:id(.:format) …

Gordon White
- 27
- 5
0
votes
1 answer
Change URL by filter
I am using friendly_id so that I can create such URLs:
/search/france/weekly/toyota-95
My routes:
scope to: 'search#show' do
get '/search/:car_country_id/:rental_type_id/:car_group_id', as: 'search_country'
end
At the search#show view I have a…

Shalafister's
- 761
- 1
- 7
- 34
0
votes
1 answer
Rails | nested routes if nil
I have used friendly_id and globalize gem. So I can generate routes as;
/search/france/weekly/toyota-95
Here is my routes;
namespace :search do
resources :car_countries, path: '', only: [] do
resources :rental_types, path: '', only: [] do
…

Shalafister's
- 761
- 1
- 7
- 34
0
votes
2 answers
Why can't I edit a nested model now?
I get the following error:
undefined method `campaign_fax_path' for #
I have routes defined as follows:
map.resources campaigns, :has_many => :faxes
The error occurs here:
NoMethodError in Faxes#edit
Showing…

Satchel
- 16,414
- 23
- 106
- 192
0
votes
1 answer
How to configure child routes properly?Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'parent/child1
I am getting the following error after configuring child routes.
Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'parent/child1
app.routing.ts
{ path: 'home', component: homeComponent},
{ path: 'about', component:…

Keshav1007
- 605
- 2
- 8
- 21
0
votes
2 answers
No route matches {:action=>"show", :guide_id=>#, :id=>nil} missing required keys: [:id]
I know the question is asked number of times and I am also having same error but could'nt fix it.
I am getting below error if I try to edit my record:
No route matches {:action=>"show", :controller=>"guide/packages", :guide_id=>#
user5084534
0
votes
1 answer
rails pagination nested routes
I am attempting to put a contacts paginated partial inside of a view for rooftops. Rooftops has many contacts and also has a nested route allowing /rooftops/1/contacts. When I try to create the will_paginate links I get /rooftops/1 as the path…

rrivas
- 260
- 3
- 9
0
votes
1 answer
form_for multiple instances of deep nested routes
I'm putting together a way for teams to enter sporting tournaments. When entering a team, the user must also register all the players for that team. My associations & routes are setup as follows:
class Tournament < ApplicationRecord
has_many…

afishintaiwan
- 85
- 9
0
votes
2 answers
nested routes with react router
I am very new in react. I am working with typescript-react(.tsx). I am struggling in nested routes. if url is like file:///D:/original/22-02-2017/app.html#/job-home
then the "horMenu" component will loads, in that only one horizontal menu is…

Hardik Chaudhary
- 1,200
- 1
- 8
- 24
0
votes
1 answer
Understanding how nested routes work in react-router
I am really struggling to understand how nested routes work with react-route.
I have looked at many similar questions but I can't get things to work.
My goal is to have child components displayed inside their parent component and accessed…

TheSoul
- 4,906
- 13
- 44
- 74
0
votes
2 answers
Rails routes - context for nested resource url
I'm trying to create a nested path for a show action of a nested resource
user.rb
has_many :fan_receives, as: :fanzone_owner, class_name: "FanActivity"
fan_activity.rb
belongs_to :fanzone_owner, polymorphic: true
In my routes.rb
match…

oniiko
- 41
- 6
0
votes
1 answer
React JS component with nested navigation
I've been having some trouble with the following. I've tried for a few hours to find some help through searching, but have come up empty handed. It could be that I don't know the name of what I'm trying to do, but I figured I'd ask here.
I've been…

StevenAntonio
- 35
- 1
- 9
0
votes
1 answer
Rails 5 shallow routing on parent, but not shallow for child
I have an issue regarding shallow routing in rails. I have a set of routes nested 3 levels users have many portfolios have many displays. What i want to do is have a shallow route for my portfolios, but have verbose routing for displays. I've tried…

PhilVarg
- 4,762
- 2
- 19
- 37
0
votes
2 answers
Location did not match - Nested Routes Not Working
I'm trying to use Nested Routes but it gives me following error:
Here is my routes code. I'm getting error when I try to use nested routes for Manufacturers.
import React from 'react';
import {Router, IndexRoute, Route, hashHistory} from…

Muhammad Ateeq Azam
- 1,009
- 1
- 12
- 26
0
votes
1 answer
nested routes in expressJS
I have the following routes defined
router.get('/:company', function (req, res, next) {
// 1. call database and get company data
// 2. render company view
})
router.get('/:company/employees', function (req, res, next) {
// 1. call…

handsome
- 2,335
- 7
- 45
- 73