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.
|
<code/>and<pre/>for code samples.