controller icon indicating copy to clipboard operation
controller copied to clipboard

Action support for “respond_to”

Open timriley opened this issue 2 months ago • 1 comments

This needs to be “native” to the way Hanami::Action operates, so: explicit receivers, no implicit state.

Maybe it just hangs off the request?

def handle(request, response)
  request.respond_to do |format|
    format.json do
      # ...
    end
  end
end

Either way, we of course have control over what goes into the request/response objects before they get passed into #handle, so we can set them up to have the information they need to expose this API.

timriley avatar Nov 13 '25 23:11 timriley

Definitely keen for @afomera’s thoughts on this since this would be a replacement for hanami-omakase’s version.

timriley avatar Nov 13 '25 23:11 timriley