From e807476d31fd15fbf8808d739b0afada4faeece9 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 15 Apr 2010 18:59:24 +0200 Subject: [PATCH] added convenience methods #notice and #alert to flash.now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/lib/action_dispatch/middleware/flash.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 99b36366d6e2c..adde183cdb62b 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -49,6 +49,16 @@ def []=(k, v) def [](k) @flash[k] end + + # Convenience accessor for flash.now[:alert]= + def alert=(message) + self[:alert] = message + end + + # Convenience accessor for flash.now[:notice]= + def notice=(message) + self[:notice] = message + end end class FlashHash < Hash