提交 47bc138f 编写于 作者: J Jeremy Kemper

Write strings to fragment cache, not outputbuffers

上级 1f6c5677
......@@ -41,7 +41,9 @@ def fragment_for(buffer, name = {}, options = nil, &block) #:nodoc:
else
pos = buffer.length
block.call
write_fragment(name, buffer[pos..-1], options)
content = buffer[pos..-1]
content = content.as_str if content.respond_to?(:as_str)
write_fragment(name, content, options)
end
else
block.call
......
......@@ -89,8 +89,12 @@ def to_s
self
end
def as_str
''.replace(self)
end
def to_yaml
"".replace(self).to_yaml
as_str.to_yaml
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册