aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRajinder Yadav <devguy.ca@gmail.com>2010-11-14 05:20:10 -0500
committerRajinder Yadav <devguy.ca@gmail.com>2010-11-14 05:20:10 -0500
commitf69784289b6efd0eabb674d6467b2cd0c0a4af07 (patch)
tree384e860c7edeeff8a93bb884e296313b8044bbee /railties
parent23f71c431dae9ec389a861700ea84c7b0cbf913c (diff)
downloadrails-f69784289b6efd0eabb674d6467b2cd0c0a4af07.tar.gz
rails-f69784289b6efd0eabb674d6467b2cd0c0a4af07.tar.bz2
rails-f69784289b6efd0eabb674d6467b2cd0c0a4af07.zip
added note with example for using flash in redirection
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/action_controller_overview.textile7
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile
index 3774c7fcf5..cabc0c8a7f 100644
--- a/railties/guides/source/action_controller_overview.textile
+++ b/railties/guides/source/action_controller_overview.textile
@@ -261,6 +261,13 @@ class LoginsController < ApplicationController
end
</ruby>
+Note it is also possible to assign a flash message as part of the redirection.
+
+<ruby>
+ redirect_to root_url, :notice => "You have successfully logged out"
+</ruby>
+
+
The +destroy+ action redirects to the application's +root_url+, where the message will be displayed. Note that it's entirely up to the next action to decide what, if anything, it will do with what the previous action put in the flash. It's conventional to display eventual errors or notices from the flash in the application's layout:
<ruby>