基于时间的片断缓存插件timed_fragment_cache

http://github.com/veilleperso/timed_fragment_cache/tree/master

这位的插件在Rails2.2.2上不起作用,会报错误:

ActionView::TemplateError (undefined local variable or method
`_erbout' for #<ActionView::Base:0x3652d24>)

这位老兄也遇到这个问题:http://groups.google.com/group/rubyonrails-core/browse_thread/thread/abc80158821a8868

 

可以用的插件地址应该在:http://github.com/rlivsey/timed_fragment_cache/tree/master

 

为什么会出现这个异常呢?

 

      def cache_erb_fragment(block, name = {}, options = nil, expiry = nil)
        unless perform_caching then block.call; return end
 
        fragment = get_fragment(name)
        if expiry && !fragment
          expire_and_write_meta(name, expiry)  
        end
 
        buffer = eval("_erbout", block.binding)
 
        if fragment
          buffer.concat(fragment)
        else
          pos = buffer.length
          block.call
          write_fragment(name, buffer[pos..-1], options)
        end
  
      end

 

 

谁能解释一下?

 

山寨的就是不一样。。。。。。。。。

你可能感兴趣的:(thread,cache,Google)