开发者

Access to config.action_controller.perform_caching value from inside a controller

Is it possible to check the value of:

config.action_controller.perform_caching

...fr开发者_如何转开发om within ApplicationController?

I have some custom caching methods that should or shouldn't be called based on this value.


ActionController::Base.perform_caching

returns true or false depending on whether the caching is enabled.


As of Rails 3.x, you can use this:

Rails.configuration.action_controller.perform_caching
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜