Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extract response setting to a method

  • Loading branch information...
commit 46eba6c30ff05b5f7e8e6015e33ddf0a385fce6f 1 parent b7a4fe1
@tenderlove tenderlove authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 actionpack/lib/action_controller/metal/rack_delegation.rb
View
10 actionpack/lib/action_controller/metal/rack_delegation.rb
@@ -9,8 +9,7 @@ module RackDelegation
:status, :location, :content_type, :to => "@_response"
def dispatch(action, request)
- @_response = ActionDispatch::Response.new
- @_response.request = request
+ set_response!(request)
super(action, request)
end
@@ -22,5 +21,12 @@ def response_body=(body)
def reset_session
@_request.reset_session
end
+
+ private
+
+ def set_response!(request)
+ @_response = ActionDispatch::Response.new
+ @_response.request = request
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.