[Haml] Fix #capture under Rails 3.

Closes gh-174
This commit is contained in:
Nathan Weizenbaum 2010-05-19 09:35:28 -07:00
parent 0da36ad799
commit 9ae8b31920
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,11 @@
* Table of contents
{:toc}
## 3.0.5 (Unreleased)
* Make sure the `#capture` helper in Rails 3
doesn't print its value directly to the template.
## 3.0.4
[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4).

View File

@ -85,7 +85,9 @@ module ActionView
module CaptureHelper
def capture_with_haml(*args, &block)
if Haml::Helpers.block_is_haml?(block)
capture_haml(*args, &block)
str = capture_haml(*args, &block)
return ActionView::NonConcattingString.new(str) if defined?(ActionView::NonConcattingString)
return str
else
capture_without_haml(*args, &block)
end