我正在尝试在 Middleman 中使用concat
(就像使用Rails one一样),但它似乎不起作用。例如,这不起作用:
-# index.html.haml
- helper
# custom_helpers.rb
module CustomHelpers
def helper
concat 'Hello, world!'
end
end
结果是一个空页面。
但是,capture
(就像Rails one一样)可以按您的预期工作。此外,使用concat
. 它根本行不通。
是我误解了什么还是 Middleman 不支持concat
?
编辑:我还发现它的haml_concat
行为符合我的预期。为什么concat
不能类似地工作?