7
我创建了一个haml-partial,我想用它作为默认头。在渲染时,我可以选择给它一个块来替换部分默认内容。Rails 4,使用haml内的可选块渲染部分/布局
我已经试过许多东西:
render partial: "partial", capture: do
# Don't really know why I tried this, Syntax error ofcourse.
render partial: "partial" do
# 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path.
render layout: "partial" do
# Works, but:
render layout: "partial"
# You invoked render but did not give any of :partial, :template, :inline, :file or :text option.
# So, it always needs the block
我不知道任何其他的选择吗?