aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth.h.rees@gmail.com>2012-09-11 22:52:58 +0100
committerGareth Rees <gareth.h.rees@gmail.com>2012-09-11 22:52:58 +0100
commit6639ef8b5a2d0655a84888f3a227cbd33b92e175 (patch)
tree1ec915164e9690e45528a8ed5b55ccf6c1dc7215
parentae3965b4752285991acb5ac8147fc9f4a88eea6d (diff)
downloadrails-6639ef8b5a2d0655a84888f3a227cbd33b92e175.tar.gz
rails-6639ef8b5a2d0655a84888f3a227cbd33b92e175.tar.bz2
rails-6639ef8b5a2d0655a84888f3a227cbd33b92e175.zip
More concise flash output
-rw-r--r--guides/source/action_controller_overview.textile10
1 files changed, 4 insertions, 6 deletions
diff --git a/guides/source/action_controller_overview.textile b/guides/source/action_controller_overview.textile
index 1d43b44391..5806faed2a 100644
--- a/guides/source/action_controller_overview.textile
+++ b/guides/source/action_controller_overview.textile
@@ -308,12 +308,10 @@ The +destroy+ action redirects to the application's +root_url+, where the messag
<html>
<!-- <head/> -->
<body>
- <% if flash[:notice] %>
- <p class="notice"><%= flash[:notice] %></p>
- <% end %>
- <% if flash[:alert] %>
- <p class="alert"><%= flash[:alert] %></p>
- <% end %>
+ <% flash.each do |name, msg| -%>
+ <%= content_tag :div, msg, class: name %>
+ <% end -%>
+
<!-- more content -->
</body>
</html>