diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 09f2c9d1..462a8a80 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -471,7 +471,7 @@ module Sinatra # compile and render template layout_was = @default_layout - @default_layout = false if layout + @default_layout = false template = compile_template(engine, data, options, views) output = template.render(self, locals, &block) @default_layout = layout_was diff --git a/test/templates_test.rb b/test/templates_test.rb index 48f0ec65..f5729f36 100644 --- a/test/templates_test.rb +++ b/test/templates_test.rb @@ -101,6 +101,15 @@ class TemplatesTest < Test::Unit::TestCase assert_equal "