Skip to content

Instantly share code, notes, and snippets.

@mru2
Created January 20, 2014 09:12
Show Gist options
  • Save mru2/8517209 to your computer and use it in GitHub Desktop.
Save mru2/8517209 to your computer and use it in GitHub Desktop.
How to return a Rack::Response in a Rails controller
def show
rack_response = Rack::Response.new(["Hello!"], 200, {'Content-Type' => 'test/plain'})
self.response = ActionDispatch::Response.new(*rack_response.to_a)
self.response.close
return
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment