aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorlambda_ <superhappyfuntime@me.com>2013-01-03 17:40:02 -0500
committerlambda_ <superhappyfuntime@me.com>2013-01-03 17:40:02 -0500
commitebdb8633bfaddfee05b4207e5c51c7cf6a790f7d (patch)
tree5701a931d0034e652aee475da58cf48a91f2c2bf /actionpack/lib/action_dispatch
parent8370e50d85bf1b73580aa45c27a8bb58de4d90b1 (diff)
downloadrails-ebdb8633bfaddfee05b4207e5c51c7cf6a790f7d.tar.gz
rails-ebdb8633bfaddfee05b4207e5c51c7cf6a790f7d.tar.bz2
rails-ebdb8633bfaddfee05b4207e5c51c7cf6a790f7d.zip
Add examples `alert=` and `notice=`, using memes
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/middleware/flash.rb10
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 f24e9b8e18..7e00510fa8 100644
--- a/actionpack/lib/action_dispatch/middleware/flash.rb
+++ b/actionpack/lib/action_dispatch/middleware/flash.rb
@@ -60,11 +60,21 @@ module ActionDispatch
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