I am using ca开发者_Python百科ches_page in controllers, like so: caches_page :index
Is there a way I can check in the view files whether the action is to be cached or not?
Thanks
No, this is not possible. All the caches_page
-method does is to register a block via after_filter
without storing any additional information. If you need to know wether the current action is to be cached, you will have to provide a clue yourself by ie. an enhanced version of caches_page
.
精彩评论