Forum: Ruby on Rails [ANN] Sidebars made Simpler: Body Builder

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Wybo W. (Guest)
on 2009-02-18 20:44
(Received via mailing list)
This plugin fixes the problem of how to organize the parts of your app
that are re-used like blocks across pages, like those in side-bars and
top-bars. It allows you to create render-points where content can be
inserted in views.

In short it allows one to set body_parts (variables that can be yielded
in views) from controllers. Also since Rails components are
notoriously slow, this is a nice alternative.

After installing the plugin you can declare body parts in your
controllers (most often only in controllers/application.rb) with:

  body_parts :top, :sidebar

Then you can fill them up in the same, or in inheriting controllers
by passing method syms to body-name_body, just like Rails filters:

  top_body :navigation_bar

The return value of these methods will be added to the body.

In the view you can display the body with

  <= yield :sidebar_body %>


  <= yield :top_body %>.

As you can see Body Builder supports multiple, user-defined bodies.
This contrary to the Simple Sidebar plugin.

See the full Body Builder docs for code examples and installation

Body Builder is under the Affero GPL, and developed by the LogiLogi
Foundation (


Wybo W.


- Informatiekunde (computer linguistics, IR, webtech), History and
- Member of the Center for Metahistory Groningen

::Free Software and Open Source Developer:
- Active in the LogiLogi Foundation (
-, Cumulative, shared commenting, publication
                           idea sharing: Where insight comes together...
- ComLinToo, a computational linguistics toolset written in Perl
JMinock (Guest)
on 2009-02-18 21:02
(Received via mailing list)
Thank you for sharing this. We have a lot of pieces of our application
which are re-used many times, this could help!

This topic is locked and can not be replied to.