@@ -830,7 +830,7 @@ it look as follows:
830830<h1>Editing post</h1>
831831
832832<%= form_for :post, url: { action: :update, id: @post.id },
833- method: :put do |f| %>
833+ method: :patch do |f| %>
834834 <% if @post.errors.any? %>
835835 <div id="errorExplanation">
836836 <h2><%= pluralize(@post.errors.count, "error") %> prohibited
@@ -863,7 +863,7 @@ method: :put do |f| %>
863863This time we point the form to the ` update ` action, which is not defined yet
864864but will be very soon.
865865
866- The ` method: :put ` option tells Rails that we want this form to be
866+ The ` method: :patch ` option tells Rails that we want this form to be
867867submitted via the ` PUT ` HTTP method which is the HTTP method you're expected to use to
868868** update** resources according to the REST protocol.
869869
@@ -873,7 +873,7 @@ Next, we need to add the `update` action. The file
873873` config/routes.rb ` will need just one more line:
874874
875875``` ruby
876- put " posts/:id" => " posts#update"
876+ patch " posts/:id" => " posts#update"
877877```
878878
879879And then create the ` update ` action in ` app/controllers/posts_controller.rb ` :
@@ -1051,7 +1051,7 @@ called `post_url` and `post_path` available to our application. These are
10511051precisely the methods that the ` form_for ` needs when editing a post, and so now
10521052you'll be able to update posts again.
10531053
1054- NOTE: The ` :as ` option is available on the ` post ` , ` put ` , ` delete ` and ` match `
1054+ NOTE: The ` :as ` option is available on the ` post ` , ` patch ` , ` put ` , ` delete ` and ` match `
10551055routing methods also.
10561056
10571057### Deleting Posts
@@ -1145,7 +1145,7 @@ get "posts/new"
11451145post " posts" => " posts#create"
11461146get " posts/:id" => " posts#show" , as: :post
11471147get " posts/:id/edit" => " posts#edit"
1148- put " posts/:id" => " posts#update"
1148+ patch " posts/:id" => " posts#update"
11491149delete " posts/:id" => " posts#destroy"
11501150```
11511151
0 commit comments