aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Bejar <jorge@wyeworks.com>2015-07-20 16:46:21 -0300
committerJorge Bejar <jorge@wyeworks.com>2015-12-09 10:53:45 -0300
commit6cb578c018b1136696f9c9d30ed1352c2c014f30 (patch)
tree824b91b0f6389e6d00ad21d83ffe31c7eb7c4e09
parent6fa2023c816e8dc8d2735a5fe87098ef5d8253f9 (diff)
downloadrails-6cb578c018b1136696f9c9d30ed1352c2c014f30.tar.gz
rails-6cb578c018b1136696f9c9d30ed1352c2c014f30.tar.bz2
rails-6cb578c018b1136696f9c9d30ed1352c2c014f30.zip
Mention the debug_exception_response_format config in guides
-rw-r--r--guides/source/api_app.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/guides/source/api_app.md b/guides/source/api_app.md
index fb3127555e..17695c5db0 100644
--- a/guides/source/api_app.md
+++ b/guides/source/api_app.md
@@ -163,6 +163,14 @@ class definition:
config.api_only = true
```
+Optionally, in `config/environments/development.rb` add the following line
+to render error responses using the API format (JSON by default) when it
+is a local request:
+
+```ruby
+config.debug_exception_response_format = :api
+```
+
Finally, inside `app/controllers/application_controller.rb`, instead of:
```ruby