Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added note with example for using flash in redirection

  • Loading branch information...
commit f69784289b6efd0eabb674d6467b2cd0c0a4af07 1 parent 23f71c4
Rajinder Yadav ryadav authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 railties/guides/source/action_controller_overview.textile
7 railties/guides/source/action_controller_overview.textile
View
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.