When building an API Rails application the ControllerExtension methods aren't available in controllers because ApplicationController inherits from ActionController::API rather than ActionController::Base.
Should the railtie instead include the extension directly into ApplicationController for Rails 5.0+ applications?
My current temporary fix is to manually include the extension in ApplicationController:
# app/controllers/application_controller.rb
class ApplicationController < ActionController::API
include ROM::Rails::ControllerExtension
end
When building an API Rails application the
ControllerExtension
methods aren't available in controllers becauseApplicationController
inherits fromActionController::API
rather thanActionController::Base
.Should the railtie instead include the extension directly into
ApplicationController
for Rails 5.0+ applications?My current temporary fix is to manually include the extension in
ApplicationController
: