caches_page :all
Asked Answered
P

2

5

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.

Pocket answered 27/4, 2011 at 20:29 Comment(0)
R
12

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

caches_page :except => []
Rodger answered 27/4, 2011 at 20:43 Comment(2)
Probably the cleanest way of handling itGuyon
I also tried in Rails 3.2.17 and it is working. ThanksEmpty
S
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
Spade answered 27/4, 2011 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.