Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

caches_page :all

Is there any way to tell Rails 3 to cache all pages in a given controller without having to list them all when calling caches_page? I tried caches_page :all, but it doesn't work.

like image 325
SZH Avatar asked Apr 27 '11 20:04

SZH


2 Answers

Kind of a bug of the implementation, but I just tried it and it works on Rails 3.0.6:

caches_page :except => []
like image 66
PreciousBodilyFluids Avatar answered Oct 12 '22 18:10

PreciousBodilyFluids


you can always do some hack like:

(YourController.public_instance_methods - ApplicationController.public_instance_methods).each do |x|
  caches_page x.to_sym
end
like image 33
Esse Avatar answered Oct 12 '22 18:10

Esse