Module

CaptureHelper

CaptureHelper exposes methods to let you extract generated markup which can be used in other parts of a template or layout file. It provides a method to capture blocks into variables through capture and a way to capture a block of markup for use in a layout through content_for.

Public Methods
capture The capture method allows you to extract part of a template into a variable. You can then use this variable anywhere in your templates or layout.
content_for Calling content_for stores a block of markup in an identifier for later use. You can make subsequent calls to the stored content in other templates or the layout by passing the identifier as an argument to yield.
Private Methods
block_content_for
capture_block
capture_erb
capture_erb_with_buffer
erb_content_for
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.