diff options
author | Francis Go <francis.go@gmail.com> | 2013-09-26 02:53:38 +1000 |
---|---|---|
committer | Francis Go <francis.go@gmail.com> | 2013-09-26 02:53:38 +1000 |
commit | f2f84cdddd124c289c004f9612f7cd3280eeae86 (patch) | |
tree | 20b94490b82a302f7d43cb96047fc6f74dc0a2b3 | |
parent | f3982858359008ec8fe43b8fa2c75aad8788cd89 (diff) | |
download | rails-f2f84cdddd124c289c004f9612f7cd3280eeae86.tar.gz rails-f2f84cdddd124c289c004f9612f7cd3280eeae86.tar.bz2 rails-f2f84cdddd124c289c004f9612f7cd3280eeae86.zip |
Getting Started Guide: posts_controller -> PostsController [ci skip]
-rw-r--r-- | guides/source/getting_started.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 5576b23d91..ddbdcad014 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -687,7 +687,7 @@ invoking the command: `rake db:migrate RAILS_ENV=production`. ### Saving data in the controller -Back in `posts_controller`, we need to change the `create` action +Back in `PostsController`, we need to change the `create` action to use the new `Post` model to save the data in the database. Open `app/controllers/posts_controller.rb` and change the `create` action to look like this: @@ -1013,7 +1013,7 @@ errors with `@post.errors.full_messages`. arguments. If the number is greater than one, the string will be automatically pluralized. -The reason why we added `@post = Post.new` in `posts_controller` is that +The reason why we added `@post = Post.new` in the `PostsController` is that otherwise `@post` would be `nil` in our view, and calling `@post.errors.any?` would throw an error. @@ -1031,7 +1031,7 @@ attempt to do just that on the new post form [(http://localhost:3000/posts/new)] We've covered the "CR" part of CRUD. Now let's focus on the "U" part, updating posts. -The first step we'll take is adding an `edit` action to `posts_controller`. +The first step we'll take is adding an `edit` action to the `PostsController`. ```ruby def edit |