aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc
diff options
context:
space:
mode:
authorJames Miller <james@jkmillertech.com>2008-09-21 08:42:45 -0700
committerJames Miller <james@jkmillertech.com>2008-09-21 08:42:45 -0700
commitf807b3cdc2cfb3ab538e7c99edd94466e1e344b3 (patch)
tree4f0da57f19157f2eaa745566ddc18a5ed524cd14 /railties/doc
parent860efecd8f44e112e447f4a233115090bdd8c3db (diff)
downloadrails-f807b3cdc2cfb3ab538e7c99edd94466e1e344b3.tar.gz
rails-f807b3cdc2cfb3ab538e7c99edd94466e1e344b3.tar.bz2
rails-f807b3cdc2cfb3ab538e7c99edd94466e1e344b3.zip
The flash
Diffstat (limited to 'railties/doc')
-rw-r--r--railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt b/railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
index c181d1432c..3259ef8a45 100644
--- a/railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
+++ b/railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
@@ -330,7 +330,12 @@ def new
end
----------------------------------------
-Our `create` action, on the other hand, instantiates a new Post object while setting its attributes to the parameters that we specify in our form:
+Our `create` action, on the other hand, instantiates a new Post object while setting its attributes to the parameters that we specify in our form. It then uses a `flash[:notice]` to inform the user of the status of the action. If the Post is saved successfully, the action will redirect to the `show` action containing our new Post simply by calling the simple `redirect_to(@post)`.
+
+.The Flash
+**************************************************************************************************************
+Rails provides the Flash so that messages can be carried over to another action, providing the user with useful information on the status of their request. In our `create` example, the user never actually sees any page rendered during the Post creation process, because it immediately redirects to the new Post as soon as the record is saved. The Flash allows us to carry over a message to the next action, so once the user is redirected back to the `show` action, they are presented with a message saying "Post was successfully created."
+**************************************************************************************************************
----------------------------------------
def create