2

Consider a partial.haml like this:

- haml_tag :body, {:id => @instance_var}

What I'm trying to do is to nest haml content under a rendered partial. Something like:

= render 'partial_file' do
    %h1 My test
    %p Trying to nest under a partial output.

But this is causing view errors like:

'nil' is not an ActiveModel-compatible object that returns a valid partial path.

Is there any similar solution to accomplish this?

4

1 回答 1

3

我根据Rails 中的建议解决了这个问题:如何呈现重复的表单块?通过将渲染指定为:layout

= render :layout => 'partial_file' do
    %h1 My test
于 2013-07-17T15:16:38.130 回答