@@ -400,7 +400,7 @@ Wait! Don’t run the tests yet. Remember we need to add the resource to the `ro
400
400
# ...
401
401
Rails.application.routes.draw do
402
402
# ...
403
- namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
403
+ namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' } do
404
404
scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
405
405
# ...
406
406
resources :products, only: [:show]
@@ -587,7 +587,7 @@ One last thing before you run your tests, just the necessary route:
587
587
# ...
588
588
Rails.application.routes.draw do
589
589
# ...
590
- namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
590
+ namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' } do
591
591
scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
592
592
resources :users, only: %i[show create update destroy] do
593
593
resources :products, only: [:create]
@@ -620,7 +620,7 @@ We are first add the action to the routes, so we don’t forget later:
620
620
# ...
621
621
Rails.application.routes.draw do
622
622
# ...
623
- namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
623
+ namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' } do
624
624
scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
625
625
resources :users, only: %i[show create update destroy] do
626
626
resources :products, only: %i[create update]
@@ -729,7 +729,7 @@ Let’s start again by adding the route name to the routes file:
729
729
# ...
730
730
Rails.application.routes.draw do
731
731
# ...
732
- namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' }, path: '/' do
732
+ namespace :api, defaults: { format: :json }, constraints: { subdomain: 'api' } do
733
733
scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
734
734
resources :users, only: %i[show create update destroy] do
735
735
resources :products, only: %i[create update destroy]
0 commit comments