我创建了一个haml-partial,我想将其用作默认标头.渲染时,我可以选择给它一个块来替换默认内容的一部分.
我尝试过多种方法:
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
还有其他我不知道的选择吗?
解决方法
使用渲染布局:“”需要块时.
使用render partial:“”不使用块时.
他们都与当地人合作并寻找预先强调的文件.