method
fragment_for
v2.1.0 -
Show latest stable
- Class:
ActionController::Caching::Fragments
fragment_for(block, name = {}, options = nil)public
No documentation available.
# File actionpack/lib/action_controller/caching/fragments.rb, line 63
def fragment_for(block, name = {}, options = nil) #:nodoc:
unless perform_caching then block.call; return end
buffer = yield
if cache = read_fragment(name, options)
buffer.concat(cache)
else
pos = buffer.length
block.call
write_fragment(name, buffer[pos..-1], options)
end
end