开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜