I tried to namespace my resources and controllers, but now when I try to run my server it keeps getting this error:
JSONAPI: Could not find resource 'categories'. (Class CategoryResource not found)
controller/api/v1/categories_controller.rb
class Api::V1::CategoriesController < ApplicationController
end
resources/api/v1/category_resource.rb
class Api::V1::CategoryResource < JSONAPI::Resource
attribute :name
has_many :posts
end
I don't know what is triggering this error. I even removed the files and the reference to Category from the routes.rb
routes.rb
namespace :api do
namespace :v1 do
jsonapi_resources :categories
end
end
This started after I moved the files from the root of controllers
and resources
to api/v1
. What is wrong with my project?