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.
Asked
Active
Viewed 946 times
5

Shlomo Zalman Heigh
- 3,968
- 8
- 41
- 71
2 Answers
12
Kind of a bug of the implementation, but I just tried it and it works on Rails 3.0.6:
caches_page :except => []

PreciousBodilyFluids
- 11,881
- 3
- 37
- 44
-
1Probably the cleanest way of handling it – user229044 Apr 27 '11 at 21:47
-
I also tried in Rails 3.2.17 and it is working. Thanks – Deepak Lamichhane Mar 25 '15 at 10:52
2
you can always do some hack like:
(YourController.public_instance_methods - ApplicationController.public_instance_methods).each do |x|
caches_page x.to_sym
end

Esse
- 3,278
- 2
- 21
- 25