diff options
author | Mikhail Dieterle <MikDiet@gmail.com> | 2013-04-28 14:36:00 +0300 |
---|---|---|
committer | Mikhail Dieterle <MikDiet@gmail.com> | 2013-04-28 14:36:00 +0300 |
commit | 9c18cb1e70718c2b3fc20efed26f544b79c3ce6d (patch) | |
tree | e4be3fe91b0d4f4ecae9cb4f67a711b51b41e5ee | |
parent | 4ac1a72630447391417970eafa842983aa2a3377 (diff) | |
download | rails-9c18cb1e70718c2b3fc20efed26f544b79c3ce6d.tar.gz rails-9c18cb1e70718c2b3fc20efed26f544b79c3ce6d.tar.bz2 rails-9c18cb1e70718c2b3fc20efed26f544b79c3ce6d.zip |
Use instance variables in redirect_to
-rw-r--r-- | guides/source/getting_started.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index cd7bc399ac..bdb9d3e51f 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -534,7 +534,7 @@ def create @post = Post.new(params[:post]) @post.save - redirect_to post + redirect_to @post end ``` @@ -609,7 +609,7 @@ look like this: @post = Post.new(params[:post].permit(:title, :text)) @post.save - redirect_to post + redirect_to @post end ``` @@ -763,7 +763,7 @@ def create @post = Post.new(params[:post].permit(:title, :text)) if @post.save - redirect_to post + redirect_to @post else render 'new' end @@ -900,7 +900,7 @@ def update @post = Post.find(params[:id]) if @post.update(params[:post].permit(:title, :text)) - redirect_to post + redirect_to @post else render 'edit' end |