rom-rb / rom-rails

Rails integration for Ruby Object Mapper
http://rom-rb.org
MIT License
159 stars 51 forks source link

ControllerExtension for ApplicationController::API #85

Closed zorab47 closed 6 years ago

zorab47 commented 6 years ago

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