I've found myself needing to mix a haml layout with an erb template -
admittedly pretty niche! - and looking through tilt.rb I thought it'd
be possible to render my layout.haml with the erb rendering passed
through in a block.
haml(:layout, {:layout => false}){ erb(:template, :layout => false) }
At the moment the block gets lost in base.rb's haml helper. Is there
any particular reason that blocks aren't passed through? A quick
tinker and this works as I'd expected:
module Sinatra
module Templates
def haml(template, options={}, locals={}, &block)
render :haml, template, options, locals, &block
end
end
end
Cheers
Mike