aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/api_app.md
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/api_app.md')
-rw-r--r--guides/source/api_app.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/guides/source/api_app.md b/guides/source/api_app.md
index fb3127555e..86baa9ee84 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
@@ -208,7 +216,7 @@ building, and make sense in an API-only Rails application.
You can get a list of all middlewares in your application via:
```bash
-$ rake middleware
+$ rails middleware
```
### Using the Cache Middleware