Module: ActionParamCaching::Rails::ActionController
- Defined in:
- lib/action_param_caching/rails/action_controller.rb
Instance Attribute Summary collapse
-
#action_cache_configs ⇒ Object
readonly
Returns the value of attribute action_cache_configs.
Instance Method Summary collapse
Instance Attribute Details
#action_cache_configs ⇒ Object (readonly)
Returns the value of attribute action_cache_configs.
4 5 6 |
# File 'lib/action_param_caching/rails/action_controller.rb', line 4 def action_cache_configs @action_cache_configs end |
Instance Method Details
#cache_with_params(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/action_param_caching/rails/action_controller.rb', line 6 def cache_with_params( = {}) @action_cache_configs = {} if @action_cache_configs.nil? [:on].each do |action| @action_cache_configs[action] = ActionParamCaching::ActionConfig.new(self.controller_path, action, [:with_set_or_subset], [:filter_starting_with], [:expires_in]) unless @action_cache_configs[action] end [:on].each do |action| config = @action_cache_configs[action] unless config.did_config_cache caches_action action, config.cache_args config.did_config_cache = true end end if [:expires_in] caches_action :expires_in => [:expires_in] end end |