Skip to content

Commit

Permalink
Merge pull request rails#17153 from yuki24/fix-doc-format-for-rescue-…
Browse files Browse the repository at this point in the history
…responses

[Railsguides] Fix style for rescue responses doc [ci skip]
  • Loading branch information
seuros committed Oct 3, 2014
2 parents d93854f + d76380c commit c9e510c
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions guides/source/configuring.md
Expand Up @@ -368,24 +368,25 @@ encrypted cookies salt value. Defaults to `'signed encrypted cookie'`.

```ruby
config.action_dispatch.rescue_responses = {
'ActionController::RoutingError' => :not_found,
'AbstractController::ActionNotFound' => :not_found,
'ActionController::MethodNotAllowed' => :method_not_allowed,
'ActionController::UnknownHttpMethod' => :method_not_allowed,
'ActionController::NotImplemented' => :not_implemented,
'ActionController::UnknownFormat' => :not_acceptable,
'ActionController::InvalidAuthenticityToken' => :unprocessable_entity,
'ActionDispatch::ParamsParser::ParseError' => :bad_request,
'ActionController::BadRequest' => :bad_request,
'ActionController::ParameterMissing' => :bad_request,
'ActiveRecord::RecordNotFound' => :not_found,
'ActiveRecord::StaleObjectError' => :conflict,
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
'ActiveRecord::RecordNotSaved' => :unprocessable_entity
'ActionController::RoutingError' => :not_found,
'AbstractController::ActionNotFound' => :not_found,
'ActionController::MethodNotAllowed' => :method_not_allowed,
'ActionController::UnknownHttpMethod' => :method_not_allowed,
'ActionController::NotImplemented' => :not_implemented,
'ActionController::UnknownFormat' => :not_acceptable,
'ActionDispatch::ParamsParser::ParseError' => :bad_request,
'ActionController::BadRequest' => :bad_request,
'ActionController::ParameterMissing' => :bad_request,
'ActiveRecord::RecordNotFound' => :not_found,
'ActiveRecord::StaleObjectError' => :conflict,
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
'ActiveRecord::RecordNotSaved' => :unprocessable_entity,
'ActionController::InvalidAuthenticityToken'
=> :unprocessable_entity
}
```

Any execptions that are not configured will be assigned to 500 Internal server error.
Any execption that is not configured will be assigned to 500 Internal server error.

* `ActionDispatch::Callbacks.before` takes a block of code to run before the request.

Expand Down

0 comments on commit c9e510c

Please sign in to comment.