public Method

Fragments.fragment_for(block, name = {}, options = nil) { || ... }

There's no documentation for this item.

Source Code

# File 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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.