I'm just starting to work with rails-api, and I wanted to implement some admin user interface for the backend side. As I'm used to activeadmin gem, I tried to use it here. I followed some steps to enable the middleware needed to run it, since it was in API mode.
One of the steps was to change in the application_controller.rb
the following:
class ApplicationController < ActionController::API
end
to
class ApplicationController < ActionController::Base
end
and then create a api_controller.rb
and make it inherit from ActionController::API
class ApiController < ActionController::API
end
following these steps I have activeadmin running well. My problem is that now when I trie to run rails generate scaffold command to generate new models it stops at
invoke inherited_resources_controller
and throws the next error:
Could not find "api_controller.rb" in any of your source paths.
I suppose that I can just could the controller manually and it would be fine(?), but I would still like to know why this happens and how to fix it as it would save me time.