Permalink
Browse files

✂️

[ci skip]
  • Loading branch information...
1 parent 6b2cfe3 commit 6f01a68cc389f0e2fd669e3ee9150087cc7bdc8f @rafaelfranca rafaelfranca committed Jun 15, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 guides/source/getting_started.md
@@ -264,7 +264,7 @@ Blog::Application.routes.draw do
end
```
-If you run `rake routes`, you'll see that all the routes for the
+If you run `rake routes`, you'll see that all the routes for the
standard RESTful actions.
```bash
@@ -532,7 +532,7 @@ and change the `create` action to look like this:
```ruby
def create
@post = Post.new(post_params)
-
+
@post.save
redirect_to @post
end
@@ -560,14 +560,14 @@ whether the model was saved or not.
If you submit the form again now, Rails will complain about not finding
the `show` action. That's not very useful though, so let's add the
-`show` action before proceeding.
+`show` action before proceeding.
```ruby
post GET /posts/:id(.:format) posts#show
```
The special syntax `:id` tells rails that this route expects an `:id`
-parameter, which in our case will be the id of the post.
+parameter, which in our case will be the id of the post.
As we did before, we need to add the `show` action in
`app/controllers/posts_controller.rb` and its respective view.
@@ -628,7 +628,7 @@ Visit <http://localhost:3000/posts/new> and give it a try!
### Listing all posts
-We still need a way to list all our posts, so let's do that.
+We still need a way to list all our posts, so let's do that.
We'll use a specific route from `config/routes.rb`:
```ruby
@@ -770,7 +770,7 @@ def create
@post = Post.new(params[:post].permit(:title, :text))
if @post.save
- redirect_to @post
+ redirect_to @post
else
render 'new'
end
@@ -1092,7 +1092,7 @@ together.
</table>
```
-Here we're using `link_to` in a different way. We pass the named route as the first argument,
+Here we're using `link_to` in a different way. We pass the named route as the first argument,
and then the final two keys as another argument. The `:method` and `:'data-confirm'`
options are used as HTML5 attributes so that when the link is clicked,
Rails will first show a confirm dialog to the user, and then submit the link with method `delete`.
@@ -1103,7 +1103,7 @@ generated the application. Without this file, the confirmation dialog box wouldn
![Confirm Dialog](images/getting_started/confirm_dialog.png)
Congratulations, you can now create, show, list, update and destroy
-posts.
+posts.
TIP: In general, Rails encourages the use of resources objects in place
of declaring routes manually.

0 comments on commit 6f01a68

Please sign in to comment.