From 648e2300a71dbed939f442e0998819f7423b8b60 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 --- actionpack/lib/action_dispatch/middleware/flash.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 99b3636..adde183 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -49,6 +49,16 @@ module ActionDispatch 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 -- 1.7.0.4