Hi all,
Since dry-rails include controller only in the ApplicationController, its not possible to use safe_params and others methods if you are working in a Rails API when you controller inherits from ActionController::API. Whats is the best way to handle this? (I tried both solutions and works)
-
include helpers the ActionController::API in order to works “out-of-the-box” for Rails in API mode (I could start a PR for this if its a good idea)
like:
start do
ActionController::Base.include(Dry::Rails::Features::ControllerHelpers)
ActionController::API.include(Dry::Rails::Features::ControllerHelpers)
end -
include Dry::Rails::Features::ControllerHelpers in my controllers