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の推奨に従ってこれを解決しました: How to render repetitive form block? レンダリングを次のように指定することにより:layout

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