Skip to content

HAML partial rendering fails because of missing _erbout binding #1639

Closed
@freesteph

Description

@freesteph

Steps to reproduce

  1. Setup HAML for a simple nanoc project ;
  2. Try and render a HAML partial with a block ;
  3. Rendering fails

Expected behavior

The template compiles normally.

Actual behavior

NameError: undefined local variable or method `_erbout' for #<Nanoc::Core::Context:0x0000000107a373b8 @content="%h1 My simple page.\n\n= render(\"/partials/foobar.haml\") do\n  %h2 This should work normally\n", @item=<Nanoc::Core::CompilationItemView identifier=/page.haml>, @rep=<Nanoc::Core::CompilationItemRepView item.identifier=/page.haml name=default>, @item_rep=<Nanoc::Core::CompilationItemRepView item.identifier=/page.haml name=default>, @items=<Nanoc::Core::ItemCollectionWithRepsView>, @layouts=<Nanoc::Core::LayoutCollectionView>, @config=<Nanoc::Core::ConfigView>>

Details

I'm probably doing something wrong but I just cannot figure out what it is. I've made a repo with the full files but it looks roughly like this:

# content/page.haml
%h1 Example page

= render("/partials/foobar.haml") do
  %h2 This should work normally
# layout/partials/foobar.haml
.foobar
  %h2 This is a partial rendered from a page

  - if block_given?
    = yield

Crash log

https://gist.github.com/freesteph/13a20fe7a618f1229e2d6b7c6073a8d6

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions