Module: Catche::Controller::Base::ClassMethods
- Defined in:
- lib/catche/controller/base.rb
Instance Method Summary collapse
-
#catche(model, *args) ⇒ Object
Caches a controller action by tagging it.
Instance Method Details
#catche(model, *args) ⇒ Object
Caches a controller action by tagging it. Supports any option parameters caches_action supports.
catche Project, :index
catche Task, :through => :project
14 15 16 17 18 19 20 |
# File 'lib/catche/controller/base.rb', line 14 def catche(model, *args) = args. tag = Proc.new { |controller| Catche::Tag::Object.for(model, controller.class, ) } # Use Rails caches_action to pass along the tag caches_action(*args, { :tag => tag }.merge()) end |