We need to omit the api out of the links URLs (eg: http://localhost:3001/api/v3/people). Our valid URL should look like this: http://localhost:3001/v3/people.
Here's a sample of how our routes.rb file is built:
Our routes.rb:
Rails.application.routes.draw do
scope module: :api do
namespace :v3 do
jsonapi_resources :people
jsonapi_resources :providers
end
end
end
According to the rake routes task on our person model:
v3_people GET /v3/people(.:format) api/v3/people#index
POST /v3/people(.:format) api/v3/people#create
v3_person GET /v3/people/:id(.:format) api/v3/people#show
PATCH /v3/people/:id(.:format) api/v3/people#update
PUT /v3/people/:id(.:format) api/v3/people#update
DELETE /v3/people/:id(.:format) api/v3/people#destroy
We need to omit the
api
out of thelinks
URLs (eg:http://localhost:3001/api/v3/people
). Our valid URL should look like this:http://localhost:3001/v3/people
.Here's a sample of how our routes.rb file is built:
Our routes.rb:
According to the
rake routes
task on ourperson
model:But the response output looks like this:
If we can get the
/api
omitted from thelinks
, all will be golden.Thanks in advance.