# CacheFix module CacheFix module ActionView module Helpers module CacheHelper def cache(name = {}, force = false, &block) @controller.cache_erb_fragment(block, name,nil, force) end end end end module ActionController module Caching module Fragments def cache_erb_fragment(block, name = {}, options = nil,force = false) unless perform_caching then block.call; return end buffer = eval("_erbout", block.binding) if !force && cache = read_fragment(name, options) buffer.concat(cache) else pos = buffer.length block.call write_fragment(name, buffer[pos..-1], options) end end end end end end