Rails 3 Beta 2, Haml, Nested Layouts and LocalJumpError

Posted by CJ Bryan on Stack Overflow See other posts from Stack Overflow or by CJ Bryan
Published on 2010-04-12T15:46:59Z Indexed on 2010/06/02 23:44 UTC
Read the original article Hit count: 494

Alright, I'm trying to create an app with nested templates. I'm using Rails 3 Beta 2 and Haml. I've poked around and I've decided to take the clearest approach and have structured my templates like so:

# application.html.haml
!!!
%body
  %h1 Outermost Template
  = yield(:foobar)

# inner.html.haml
- content_for :foobar do
  %h2 Inner Template
  = yield

= render :file => 'layouts/application'

# foo_controller.rb
layout 'inner'

With all of this, I get a LocalJumpError with the message no block given. The stack traces are blank and pretty unhelpful. Any ideas? Are these known issues?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby