Module: Catche::Controller::ClassMethods
- Defined in:
- lib/catche/controller.rb
Instance Method Summary collapse
-
#catche(model, *args) ⇒ Object
Caches a controller action.
- #catche? ⇒ Boolean
Instance Method Details
#catche(model, *args) ⇒ Object
Caches a controller action.
catche Project, :index, :resource_name => :project
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/catche/controller.rb', line 25 def catche(model, *args) = args. self.catche_model = model self.catche_resource_name = [:resource_name] || self.catche_model.name.downcase.to_sym case [:type] when :page then caches_page *args, else caches_action *args, end end |
#catche? ⇒ Boolean
37 38 39 |
# File 'lib/catche/controller.rb', line 37 def catche? self.catche_model.present? end |