Tips – Rails expire fragment cache outside

Posted by AllenWei | Posted in RubyOnRails, Tips | Posted on 15-02-2010-05-2008

View Comments




<brd these code in where you want to use expire_fragment
include ActionController::Caching::Fragments

[cc lang="rails"]
 def cache_store
      ActionController::Base.cache_store
    end

    def self.benchmark( *params )
      yield
    end

    def cache_configured?
      true
    end
Then you can call expire_fragment(key,options)

Ads Plugin created by Jake Ruston's Wordpress Plugins - Powered by and football database.