Skip to content
Browse files

Add examples `alert=` and `notice=`, using memes

  • Loading branch information...
1 parent 8370e50 commit ebdb8633bfaddfee05b4207e5c51c7cf6a790f7d lambda_ committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/lib/action_dispatch/middleware/flash.rb
View
10 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -60,11 +60,21 @@ def [](k)
end
# Convenience accessor for flash.now[:alert]=
+ #
+ # Example:
+ #
+ # flash.alert = "Error: no cheezburger"
+ # # Equivlant to flash[:alert] = "No cheezburger"
def alert=(message)
self[:alert] = message
end
# Convenience accessor for flash.now[:notice]=
+ #
+ # Example:
+ #
+ # flash.notice = "Bukkit stolen"
+ # # Equivlant to flash[:notice] = "Bukkit stolen"
def notice=(message)
self[:notice] = message
end

0 comments on commit ebdb863

Please sign in to comment.
Something went wrong with that request. Please try again.