mirror of https://github.com/rails/rails
[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:
parent
749e289554
commit
7143e0da03
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue