Skip to content

Commit

Permalink
Use instance variables in redirect_to
Browse files Browse the repository at this point in the history
  • Loading branch information
mikdiet committed Apr 28, 2013
1 parent 4ac1a72 commit 9c18cb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guides/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def create
@post = Post.new(params[:post])

@post.save
redirect_to post
redirect_to @post
end
```

Expand Down Expand Up @@ -609,7 +609,7 @@ look like this:
@post = Post.new(params[:post].permit(:title, :text))
@post.save
redirect_to post
redirect_to @post
end
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9c18cb1

Please sign in to comment.