aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/components.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/components.rb')
-rw-r--r--actionpack/lib/action_controller/components.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb
index 312595c21f..62f6ee518d 100644
--- a/actionpack/lib/action_controller/components.rb
+++ b/actionpack/lib/action_controller/components.rb
@@ -50,9 +50,13 @@ module ActionController #:nodoc:
private
def component_response(options, reuse_response = true)
- c = component_class(options)
- c.after_filter {|c| flash.keep }
- c.process(request_for_component(options), reuse_response ? @response : response_for_component)
+ begin
+ ActionController::Flash::FlashHash.avoid_sweep = true
+ Thread.current[:p] = component_class(options).process(request_for_component(options), reuse_response ? @response : response_for_component)
+ ensure
+ ActionController::Flash::FlashHash.avoid_sweep = false
+ end
+ Thread.current[:p]
end
def component_class(options)