提交 7143e0da 编写于 作者: Y Yuki Nishijima

[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.
上级 749e2895
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册