Permalink
Browse files

mention the alert and notice accessors on the flash

  • Loading branch information...
1 parent 9f4d3a1 commit 76c569344be9afbc9a6cf5471c2996ecdbd100f6 @tilsammans tilsammans committed Aug 27, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -30,6 +30,11 @@ def flash
# <div class="notice"><%= flash[:notice] %></div>
# <% end %>
#
+ # Since the +notice+ and +alert+ keys are a common idiom, convenience accessors are available:
+ #
+ # flash.alert = "You must be logged in"
+ # flash.notice = "Successfully created post"
+ #
# This example just places a string in the flash, but you can put any object in there. And of course, you can put as
# many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
#

0 comments on commit 76c5693

Please sign in to comment.