mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
extract response setting to a method
This commit is contained in:
parent
b7a4fe18f2
commit
46eba6c30f
1 changed files with 8 additions and 2 deletions
|
@ -9,8 +9,7 @@ module ActionController
|
|||
: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 @@ module ActionController
|
|||
def reset_session
|
||||
@_request.reset_session
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_response!(request)
|
||||
@_response = ActionDispatch::Response.new
|
||||
@_response.request = request
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue