未验证 提交 3051007c 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #36060 from st0012/fix-35602-doc

Add ActionController::Caching into api app's document [ci skip]
......@@ -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.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册