[guides] Use `match ..., via: :all` in the custom exceptions app [ci skip]

Using `get` results in an unexpected error page(returning empty body) for requests of other HTTP mehtods other than GET. Use `match ..., via:
:all` so the exceptions app can be more stable.
This commit is contained in:
Yuki Nishijima 2014-09-06 19:32:49 -07:00
parent 749e289554
commit 7143e0da03
1 changed files with 3 additions and 3 deletions

View File

@ -1183,9 +1183,9 @@ First define your app own routes to display the errors page.
* `config/routes.rb`
```ruby
get '/404', to: 'errors#not_found'
get '/422', to: 'errors#unprocessable_entity'
get '/500', to: 'errors#server_error'
match '/404', via: :all, to: 'errors#not_found'
match '/422', via: :all, to: 'errors#unprocessable_entity'
match '/500', via: :all, to: 'errors#server_error'
```
Create the controller and views.