aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/components.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 06:11:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-12 06:11:17 +0000
commitff986f19af30efd05d413b37b22c295616804219 (patch)
tree1965bc8de0710d147870380655a9a489cb139368 /actionpack/lib/action_controller/components.rb
parent050c3964d8fe8d68c03fff593e3c09b5eae77a46 (diff)
downloadrails-ff986f19af30efd05d413b37b22c295616804219.tar.gz
rails-ff986f19af30efd05d413b37b22c295616804219.tar.bz2
rails-ff986f19af30efd05d413b37b22c295616804219.zip
Flash shouldnt depend on components either [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/components.rb')
-rw-r--r--actionpack/lib/action_controller/components.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/components.rb b/actionpack/lib/action_controller/components.rb
index 28480e47b6..a9c850c49d 100644
--- a/actionpack/lib/action_controller/components.rb
+++ b/actionpack/lib/action_controller/components.rb
@@ -51,6 +51,9 @@ module ActionController #:nodoc:
alias_method :set_session_options_without_components, :set_session_options
alias_method :set_session_options, :set_session_options_with_components
+
+ alias_method :flash_without_components, :flash
+ alias_method :flash, :flash_with_components
end
# If this controller was instantiated to process a component request,
@@ -110,6 +113,19 @@ module ActionController #:nodoc:
end
end
+ def flash_with_components(refresh = false)
+ if @flash.nil? || refresh
+ @flash =
+ if @parent_controller
+ @parent_controller.flash
+ else
+ flash_without_components
+ end
+ end
+
+ @flash
+ end
+
private
def component_response(options, reuse_response)
klass = component_class(options)