I want to use the thin middleware layer for my API controllers, but I still need dashboard views for my application.
I have a Base APIController:
class API::APIController < ApplicationController
end
Which provides some base auth methods to actual API resource controllers:
class API::V1::AgentsController < API::APIController
end
Using rails-api, I'd like to still generate views for my other controllers, yet still benefit from the thinner middleware for my API Controllers, so can I do the following:
class ApplicationController < ActionController::Base
end
class API::APIController < ActionController::API
end
All of my non-API controllers will simply inherit from ApplicationController and be able to generate views as per normal, while my API controllers enjoy better performance. Would this work?
Thanks for the advice.