aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYaroslav Markin <yaroslav@markin.net>2009-01-01 21:57:29 +0300
committerYaroslav Markin <yaroslav@markin.net>2009-01-01 21:57:29 +0300
commit1a858f87425cb3ae5815d0356605ef74a4ae174b (patch)
tree972eb90c9b5363aa0b32d8a099d4d4ed6105fe31 /actionpack/lib
parent34a10b42421cd39520bff067ee9ed5fb83b75b15 (diff)
downloadrails-1a858f87425cb3ae5815d0356605ef74a4ae174b.tar.gz
rails-1a858f87425cb3ae5815d0356605ef74a4ae174b.tar.bz2
rails-1a858f87425cb3ae5815d0356605ef74a4ae174b.zip
Update flash[] docs a bit.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/flash.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/flash.rb b/actionpack/lib/action_controller/flash.rb
index 9856dbed2a..56ee9c67e2 100644
--- a/actionpack/lib/action_controller/flash.rb
+++ b/actionpack/lib/action_controller/flash.rb
@@ -4,20 +4,22 @@ module ActionController #:nodoc:
# action that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can
# then expose the flash to its template. Actually, that exposure is automatically done. Example:
#
- # class WeblogController < ActionController::Base
+ # class PostsController < ActionController::Base
# def create
# # save post
# flash[:notice] = "Successfully created post"
- # redirect_to :action => "display", :params => { :id => post.id }
+ # redirect_to posts_path(@post)
# end
#
- # def display
+ # def show
# # doesn't need to assign the flash notice to the template, that's done automatically
# end
# end
#
- # display.erb
- # <% if flash[:notice] %><div class="notice"><%= flash[:notice] %></div><% end %>
+ # show.html.erb
+ # <% if flash[:notice] %>
+ # <div class="notice"><%= flash[:notice] %></div>
+ # <% end %>
#
# 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.