Browse files

Update the readme (we now support haml)

  • Loading branch information...
foca committed May 19, 2009
1 parent d7c3a41 commit e586a107ed19cdee69cfb81e31c01de51f39d54d
Showing with 15 additions and 7 deletions.
  1. +15 −7 README.rdoc
@@ -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
+ - 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
@@ -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[], inspired on the Ruby on Rails
-helpers with the same name.
+helpers with the same name. Haml support by mattly[].

0 comments on commit e586a10

Please sign in to comment.