Questions tagged [nested-routes]

Nested routes allow to capture relationship in your routing.

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

462 questions
2
votes
1 answer

Params is being nested in params in an Rspec post request

I am currently testing a post request for a nested route with Rspec request. It is set up like this: describe 'POST /url_contents' do let!(:role) { create(:role, name: "admin") } let(:valid_attributes) { { jwt: "SAMPLE", role:…
madav
  • 2,918
  • 1
  • 13
  • 17
2
votes
1 answer

How nested lazy loading can be achieve in angular 4.3.1?

App is working fine but the Upload child routes are accessible without '/upload' too. For example '/photo', '/advertisement'. This should not be happen. I don't know why this is happening. If anyone know the solution then please…
Garima
  • 1,566
  • 2
  • 11
  • 14
2
votes
1 answer

How to get a list of nested routes declared in the router?

I have a dashboard route in my Angular 2 App which has few child routes. { path: 'app/:property', component: DashboardComponent, canActivate: [AuthGuardService], children: [ { path: 'home', component: HomeComponent } { path:…
user2125726
  • 127
  • 2
  • 10
2
votes
2 answers

rails routes cannot redirect correctly

my data hierarchy is 'Case' has many 'Categories' has many 'Tasks' I have followed document that Resources should never be nested more than 1 level deep. Therefore, I use shallow as below : my routes.rb resources :cases do resources :categories,…
sarahbones
  • 23
  • 4
2
votes
3 answers

react-router v4: how to avoid rendering parent routes when child routes miss

I'm trying to render most of my routes as children of an AppShell component, which contains a navbar. But I want to render my 404 route as a standalone component not wrapped in AppShell. It was easy with v2:
Andy
  • 7,885
  • 5
  • 55
  • 61
2
votes
1 answer

Is there a way to configure routes hierarchy in Python Flask-RESTFUL?

So let's say I have a few routes: api.add_resource(Customers, "/Customers") api.add_resource(Customer, "/Customer/") Now, the customer can have many things associated with it. Say for example, orders: api.add_resource(Customers,…
2
votes
1 answer

Rails 5 - nested routes - uninitialised constants for controllers

I'm trying to figure out how to nest routes in Rails 5 (so that related controllers are kept together. I have my controllers file tree set up as: app/controllers/users In that folder, I have controllers…
Mel
  • 2,481
  • 26
  • 113
  • 273
2
votes
1 answer

RESTful routes for has_many :through relationships?

I have 2 models - User and Activity - which are related by a has_many :through using the UserActivity model. A User can either "want" or "done" an activity, which creates a UserActivity record and sets the appropriate boolean. What would you…
Eric
  • 342
  • 1
  • 2
  • 12
2
votes
2 answers

How do I write the routes for these resources?

For my rails application the associations are as follows: A user has many bookmarks and belongs to user. A user has many friendships. A user has many reminders. A user has many comments. A bookmark has many comments. A comment belongs to a user and…
Kenny Zhang
  • 63
  • 2
  • 11
2
votes
2 answers

Rails 4: ActionController::UrlGenerationError

I have three models: class User < ActiveRecord::Base has_many :administrations has_many :calendars, through: :administrations end class Calendar < ActiveRecord::Base has_many :administrations has_many :users, through:…
2
votes
2 answers

Nested Routes with has_one in rails

G'day guys, Having a bit of an issue with Rails routes, at the moment. Have a top resource: /Customer/ which itself has only one /Quote/ resource Quotes can have both first_resources and second_resources which are collections of resources associated…
Schroedinger
  • 1,273
  • 14
  • 32
2
votes
2 answers

Nested template routes in ui.router

(AngularJS v1.2.28 - angular-ui-router v0.2.13 In my index.html I have the following:
In my app.js I have my stateProvider set up as: $urlRouterProvider.otherwise('/app/search'); $stateProvider.state("app", { …
2
votes
1 answer

Name or ID as url for restful api

I currently build a restful api with a users route. Is it more idioatic to use the username or his id as parameter if the username is unique? Either example.com/api/users/johndoe or example.com/api/users/123456 Furthermore I planed routes for a…
user3147268
  • 1,814
  • 7
  • 26
  • 39
2
votes
1 answer

Nested routes redirecting to create action with wrong route

I've created nested routes for a model called Userfolder. The routes are mapped like this: userfolder_userfolders POST /userfolders/:userfolder_id/userfolders(.:format) userfolders#create new_userfolder_userfolder GET …
Swaathi Kakarla
  • 2,227
  • 1
  • 19
  • 27
2
votes
1 answer

Nested resources in rails

I'm trying to make a simple rails app where users can create any number of playlists. I am very new to rails and am wondering if I should be nesting the resources like this: Rails.application.routes.draw do resources :users do resources…
user2804881
  • 107
  • 8