1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[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

View file

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