Tim*_*aas 8 haml rendering ruby-on-rails partial-views ruby-on-rails-4
我创建了一个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
Run Code Online (Sandbox Code Playgroud)
还有其他我不知道的选择吗?
| 归档时间: |
|
| 查看次数: |
3209 次 |
| 最近记录: |