Permalink
Browse files

Set "SprocketsApplication.use_page_caching = false" to prevent the Sp…

…rocketsController#show concatenation from being written to disk when config.action_controller.perform_caching is true
  • Loading branch information...
1 parent 4bfaa87 commit 8be0fff7a1f702dbd572c876636796693c79bc7c @sstephenson sstephenson committed with Darrick Wiebe Aug 17, 2009
Showing with 4 additions and 1 deletion.
  1. +3 −0 lib/sprockets_application.rb
  2. +1 −1 lib/sprockets_controller.rb
@@ -1,4 +1,7 @@
module SprocketsApplication
+ mattr_accessor :use_page_caching
+ self.use_page_caching = true
+
def self.routes(map)
map.resources(:sprockets, :only => [:index, :show])
end
@@ -1,5 +1,5 @@
class SprocketsController < ActionController::Base
- caches_page :show
+ caches_page :show, :if => Proc.new { SprocketsApplication.use_page_caching }
def index
show

0 comments on commit 8be0fff

Please sign in to comment.