开发者

In Rails, can I check in a view whether the action is to be cached?

开发者 https://www.devze.com 2023-01-22 04:10 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消