Questions tagged [nested-routes]

Nested routes allow to capture relationship in your routing.

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

462 questions
1
vote
1 answer

Named router and nested routes in angular 6

Can someone please assist in navigating to a specific route. I've been sitting with this for hours now. Here's what I have: const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component:…
Mbongo
  • 11
  • 5
1
vote
0 answers

Angular with multiple router outlets fails to load correctly

I have an angular app. When not logged in, I redirect to an unauthorised page. To do this, I re-ordered my routes so one with no navigation was available as this usually is the component that holds the first router outlet so pages load in the…
Aaron Gibson
  • 1,280
  • 1
  • 21
  • 36
1
vote
1 answer

Form sending me to the wrong controller despite correct URL in a Rails app

I have the following routes defined: App/config/routes.rb resources :pools do resources :match_predictions, path: "predictions", as: "predictions", only:[:index, :create, :update] post "predictions/season" => "season_predictions#create" patch…
alopez02
  • 1,524
  • 2
  • 17
  • 36
1
vote
1 answer

Ruby on Rails Tutorial, Chapter 11, Exercise 7 - Breaks my rspec tests

I'm working through Michael Hartl's excellent tutorial on Rails, but I am having trouble with exercise 7 in Chapter 11. This exercise is: Add a nested route so that /users/1/microposts shows all the microposts for user 1. (You will also have…
Kevin
  • 13
  • 3
1
vote
3 answers

How to have a namespace with action in rails?

Below I have given the code of routes.rb: resources :analytics namespace :analytics do resources :users, only: [:show, :index] end Here, I am having an analytics_controller.rb inside the controllers folder and one Analytics folder inside…
Akhil Gautam
  • 169
  • 1
  • 10
1
vote
1 answer

Vue.js nested routing

My Current Route is function route(path, view) { return { path: path, meta: meta[path], component: resolve => import(`pages/${view}View.vue`).then(resolve) } } route('/', 'Home'), route('/help', 'Help), route('/blog',…
KameR
  • 13
  • 4
1
vote
1 answer

pseudo-complex routes in rails 3

I'm trying to make some nice simple routes in Rails 3 with 2 custom matchers which assume the root :id will be a city and :city_id/:id will be a place... it seems to work fine except when trying to…
holden
  • 13,471
  • 22
  • 98
  • 160
1
vote
1 answer

rails polymorphic nested comments - cant delete them

here my git https://gist.github.com/774510 the problem is if I'm using method:destroy in the _comments.html.erb I get sent to articles/1/comments, where no route matches, furthermore the comment doesn't get deleted if I use method:delete, I get…
1
vote
2 answers

Makes 2 states share a part of resolve

I have defined two states as follows: app.config(['$stateProvider', function ($stateProvider) { $stateProvider .state('edit', { url: '/edit/{id}', templateUrl: '/htmls/h1.html', controller:…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
1
vote
4 answers

ruby-on-rails - Problem with Nested Resources

I have a Problem with Nested Resources. 2 Models User => has_many :stuffs Stuff => belongs_to :user routes.rb map.resources :stuffs map.resources :users, :has_many => [:stuffs] When i call /users/1/stuffs it presents me the Stuff for the…
Nihil
  • 23
  • 5
1
vote
0 answers

ActiveRecord::ActsAs routing problems

Upgrading an old Rails 3 app to Rails 4, multiple table inheritance gem has been changed due to deprecation. Now, using ActsAs. Nested routes are not working producing following error: undefined method `vehicle_path' for…
1
vote
0 answers

React-router v04 nested routes

Is this how I should using react-router and nested routes in react-router-dom? This code is working but I didn't fully understand the documentation so I want to be sure. main.js: const main = (props)=>(
1
vote
1 answer

Rails nested resource - setting param: issue

I have the following routes declared: resources :accounts, param: :account_id do resources :instructions, param: :instruction_id do resources :messages, param: :message_id end end So accounts, instructions, messages are the 3…
Haroon
  • 3,402
  • 6
  • 43
  • 74
1
vote
1 answer

How to use router-outlet from lazy loaded children module inside primary router-outlet

as i said here i'm developing an Angular2 app with the following project structure: I have a primary router-outlet inside "main" component and another router-outlet inside "first" component. Here is the template of the main component:
smartmouse
  • 13,912
  • 34
  • 100
  • 166
1
vote
1 answer

Understanding Routing in Rails 3

I think I am thinking about routing all wrong. I have a very simple, two model set-up: Product and Photo. Product has_many :photos, and Photo belongs_to :product. Product has a full scaffold while Photo has a photos_controller that I am working…
Adam
  • 475
  • 5
  • 18