开发者

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

开发者 https://www.devze.com 2022-12-21 10:02 出处:网络
Is it possible to check the value of: config.action_controller.perform_caching ...fr开发者_如何转开发om within ApplicationController?

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

精彩评论

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