diff options
author | Martin <m.linkhorst@googlemail.com> | 2010-04-15 18:59:24 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-15 16:52:19 +0200 |
commit | e807476d31fd15fbf8808d739b0afada4faeece9 (patch) | |
tree | 6ac776dfba3caebe5d0d0450a368afe1f482e621 /actionpack | |
parent | cdf700147c5b3ec5e4d1e7de1c2d08134568c2d1 (diff) | |
download | rails-e807476d31fd15fbf8808d739b0afada4faeece9.tar.gz rails-e807476d31fd15fbf8808d739b0afada4faeece9.tar.bz2 rails-e807476d31fd15fbf8808d739b0afada4faeece9.zip |
added convenience methods #notice and #alert to flash.now
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack')
-rw-r--r-- | 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 99b36366d6..adde183cdb 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 |