Skip to content

Commit

Permalink
Update the readme (we now support haml)
Browse files Browse the repository at this point in the history
  • Loading branch information
foca committed May 19, 2009
1 parent d7c3a41 commit e586a10
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ This allows you to capture blocks inside views to be rendered later
in this request. For example, to populate different parts of your
layout from your view.

When using this with the Haml rendering engine, you should do the
following:

- content_for :some_key do
%chunk{ :of => "html" } ...

= yield_content :some_key

<b>Note</b> that with ERB <tt>yield_content</tt> is called <b>without</b>
an '=' block (<tt><%= %></tt>), but with Haml it uses <tt>= yield_content</tt>.

Using an '=' block in ERB will output the content twice for each block,
so if you have problems with that, make sure to check for this.

== Usage

If you're writing "classic" style apps, then requring
Expand All @@ -29,13 +43,7 @@ your layout, inside the <head> tag, and each view can call
<tt>content_for</tt> setting the appropriate set of tags that should
be added to the layout.

== Warning

This only works with ERB as a rendering mechanism. I haven't figured
how to make it work with Haml. If you find a way, contact me and I'll
include it.

== Credits

Code by foca[http://github.com/foca], inspired on the Ruby on Rails
helpers with the same name.
helpers with the same name. Haml support by mattly[http://github.com/mattly].

0 comments on commit e586a10

Please sign in to comment.