Skip to content

Commit

Permalink
Merge pull request rails#39680 from mehagar/patch_code_example
Browse files Browse the repository at this point in the history
Move code example right after colon [ci skip]
  • Loading branch information
vipulnsward authored Jun 20, 2020
2 parents 9caf09e + 099a0f0 commit 6eabde3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guides/source/upgrading_ruby_on_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -1643,16 +1643,16 @@ end
If the action is not being used in a public API and you are free to change the
HTTP method, you can update your route to use `patch` instead of `put`:

`PUT` requests to `/users/:id` in Rails 4 get routed to `update` as they are
today. So, if you have an API that gets real PUT requests it is going to work.
The router also routes `PATCH` requests to `/users/:id` to the `update` action.

```ruby
resources :users do
patch :update_name, on: :member
end
```

`PUT` requests to `/users/:id` in Rails 4 get routed to `update` as they are
today. So, if you have an API that gets real PUT requests it is going to work.
The router also routes `PATCH` requests to `/users/:id` to the `update` action.

If the action is being used in a public API and you can't change to HTTP method
being used, you can update your form to use the `PUT` method instead:

Expand Down

0 comments on commit 6eabde3

Please sign in to comment.