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
我不知道任何其他的選擇嗎?