aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-23 10:42:06 -0400
committerGitHub <noreply@github.com>2019-04-23 10:42:06 -0400
commit3051007c6eb972566fde0df8b95a3dda10f33b25 (patch)
tree82b1b2bf084207bd8f6f76c2bb4197f47bf82f7a /guides
parent9f580232ad261e51d982420e07dacb1dea82edca (diff)
parente75452a70906719f2dfb7ea7dbcdaf4f2b144d38 (diff)
downloadrails-3051007c6eb972566fde0df8b95a3dda10f33b25.tar.gz
rails-3051007c6eb972566fde0df8b95a3dda10f33b25.tar.bz2
rails-3051007c6eb972566fde0df8b95a3dda10f33b25.zip
Merge pull request #36060 from st0012/fix-35602-doc
Add ActionController::Caching into api app's document [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/api_app.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/guides/source/api_app.md b/guides/source/api_app.md
index b8b6cb7874..181d39e7e0 100644
--- a/guides/source/api_app.md
+++ b/guides/source/api_app.md
@@ -420,6 +420,15 @@ Some common modules you might want to add:
- `ActionController::MimeResponds`: Support for `respond_to`.
- `ActionController::Cookies`: Support for `cookies`, which includes
support for signed and encrypted cookies. This requires the cookies middleware.
+- `ActionController::Caching`: Support view caching for the API controller. Please notice that
+ you will need to manually specify cache store inside the controller like:
+ ```ruby
+ class ApplicationController < ActionController::API
+ include ::ActionController::Caching
+ self.cache_store = :mem_cached_store
+ end
+ ```
+ Rails does *not* pass this configuration automatically.
The best place to add a module is in your `ApplicationController`, but you can
also add modules to individual controllers.