Clone this wiki locally
Blocks is a replacement / complement to content_for with yield. It allows a user to specify a block capable of taking parameters that may be passed in when using that block. A user may also specify other blocks to be prepended or appended before or after a specific block is rendered. A template may also be specified to blocks that will provide the layout for a specific component and provide default implementations for its blocks. In this way, blocks is able to offer a very simple to use table generator (table_for) and list generator (list_for).
- Building Layouts for how Blocks may enhance the way you write your layouts
- Render Order for how Blocks determines what to render when it sees "blocks.use"
- Before and After Blocks for how to specify code that gets rendered before and / or after a specific block.
- Providing a Default Implementation of a Block for how to use a block and specify what to render if that block is not found.
- table_for for how to very easily build tables for your records
- Locally Overriding the defaults in table_for for how to change the render behavior for one instance of a table
- Defining your own reusable table_for implementation for how to define your own table, custom tailored for your application.