Nested routes allow to capture relationship in your routing.
Questions tagged [nested-routes]
462 questions
0
votes
2 answers
Nested Routes - Ruby on Rails
I'm trying to get a nested route like "project/:project_id/task/:task_id", but I'm not having any luck. I've set up my routes file like this:
Rails.application.routes.draw do
get 'sessions/create'
devise_for :users, path: '', path_names: {…

James
- 411
- 1
- 4
- 18
0
votes
1 answer
Why dynamic routes need model file to be present in ember js
I was going through one of the Ember tutorial on lynda.com and I saw that the instructor defined a dynamic route as:
this.route('bookmarks', function() {
this.route('new');
this.route('edit', {
path: '/edit/:bookmark_id'
});
});
Now if I go to…

Bhavya Bansal
- 257
- 1
- 15
0
votes
1 answer
sibling routes not working in reactjs
I have a component called Profile and it has two children components
Timeline and Friends.
I can route to the timeline component inside profile from any other component like this:

Saurav Dutta
- 83
- 2
- 10
0
votes
0 answers
Child routes not working - overriding parent route Angular 6
I have a core module that has a layout component which includes a toolbar module and sidenav module. I then have a map module I want to be a child of the layout module so the html should look something like:
…

user3214545
- 2,103
- 3
- 20
- 26
0
votes
1 answer
How to update attributes of another model in Rails controller
I am a part of a team that is creating a chess app in Rails 5. I have a controller named "chess_pieces.rb". In there I have the following code:
def update
@piece = ChessPiece.find(params[:id])
@game = Game.find_by_id(@piece.game_id)
…
0
votes
1 answer
How to keep it CRUD and RESTFull in rails (concrete example)
I've difficulties with keeping my controllers not too complicated and with the basic actions rails creates when we scaffold.
Could someone tell me if the approach below is the right one.
I've a model Project and those basic routes it:
GET …

Daniel Costa
- 275
- 2
- 14
0
votes
2 answers
Rails double nested routes, broken up
I have these routes:
map.resources :categories do |category|
category.resources :sub_categories
end
map.resources :sub_categories do |sub_category|
sub_category.resources :events
end
This is only so that the url doesnt have to be…

Rabbott
- 4,282
- 1
- 30
- 53
0
votes
1 answer
About nested resources with just resources in rails
The problem is i want to have both nested resources and normal resources pointing the the same action in controller but act differently based on whether the nesting resource in available or not.
Routes.rb
resources :users do
resources…

Gunther Gib
- 117
- 10
0
votes
1 answer
React-Router nested routes names
I would like to implement that kind of routes in react-router v4.
/auth => auth home page
/auth/login => login page
/auth/register => register page
/auth/forgot => lost password page
/auth/reset => change password page
It…

Mathieu Rousseau
- 189
- 12
0
votes
1 answer
Rails Routes - URL switches parent and child ids
I'm having trouble with my routes. I want my user to be able to edit a guitar that they've added. I have two problems:
1.The url for the edit guitar view is incorrect. The IDs of the user and guitar are switched and I'm not sure why…

Jawaka72
- 65
- 8
0
votes
2 answers
Child Component is not updating when data inside object is changed
I have AppComponent on which I have defined routing.
In that, I have a setting like Home/Scan/:name where I have multiple names which call different GET service which accepts name as a parameter.
I have defined [routerLink]="['Scanning',r.name]" as…

Sanket Thotange
- 25
- 9
0
votes
2 answers
Rails 5 Edit Form can't find path with nested model - routing error
I have a controller that handles the new and edit actions for a form with a model that accepts nested attributes form another. The 'new' action works just fine. However, when I go to the edit form and submit it, it says:
Routing Error
No route…

Coder
- 61
- 9
0
votes
1 answer
Rails erb adding extra template without id
Link to image of what I'm talking about
My problem is that there is an extra template being rendered at the bottom of my list without an item id. The icons delete the item they are next to when clicked. The bottom icon is showing up even though it…

Nich B
- 1
- 1
0
votes
1 answer
Replacing REST calls with GraphQL
I've recently read about the advantages (and disatvanteges) of GraphQL over Rest API.
I am developing a webpage that consumes several different Rest APIs and Soap services. Some of those services are dependent, meaning that a result from Rest1 will…

Sharon Dorot
- 542
- 1
- 4
- 15
0
votes
1 answer
Rails custom routes
I have created an extra route called 'add' in my Groups controller.
get 'groups/add', to: 'groups#add'
My goal is to have the following link http://localhost:3000/groups/4/add
I thought about doing this nested route
resources :groups do
get…

Trenton Tyler
- 1,692
- 3
- 24
- 53