aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-02 22:48:05 -0200
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-12-07 15:05:12 -0800
commit324fa688fcd8f5b6a8e9a0226b0cb3d2829e122c (patch)
tree34fd5543fb669af788a5ad59c2e7bd38b1205243 /actionpack
parent48127c637c3cc0892d49f90a05b0034b9a625d73 (diff)
downloadrails-324fa688fcd8f5b6a8e9a0226b0cb3d2829e122c.tar.gz
rails-324fa688fcd8f5b6a8e9a0226b0cb3d2829e122c.tar.bz2
rails-324fa688fcd8f5b6a8e9a0226b0cb3d2829e122c.zip
Make controller.flash public to be used in responders.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/flash.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/metal/flash.rb b/actionpack/lib/action_controller/metal/flash.rb
index f43900faa0..b2d44c6c63 100644
--- a/actionpack/lib/action_controller/metal/flash.rb
+++ b/actionpack/lib/action_controller/metal/flash.rb
@@ -133,8 +133,20 @@ module ActionController #:nodoc:
Array(key || keys).each { |k| used ? @used << k : @used.delete(k) }
return key ? self[key] : self
end
+ end
+
+ # Access the contents of the flash. Use <tt>flash["notice"]</tt> to
+ # read a notice you put there or <tt>flash["notice"] = "hello"</tt>
+ # to put a new one.
+ def flash #:doc:
+ unless @_flash
+ @_flash = session["flash"] || FlashHash.new
+ @_flash.sweep
end
+ @_flash
+ end
+
protected
def process_action(method_name)
super
@@ -146,17 +158,5 @@ module ActionController #:nodoc:
super
@_flash = nil
end
-
- # Access the contents of the flash. Use <tt>flash["notice"]</tt> to
- # read a notice you put there or <tt>flash["notice"] = "hello"</tt>
- # to put a new one.
- def flash #:doc:
- unless @_flash
- @_flash = session["flash"] || FlashHash.new
- @_flash.sweep
- end
-
- @_flash
- end
end
end