diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 2209db97da..0f4cacc634 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -467,7 +467,7 @@ def render(engine, data, options={}, locals={}, &block) # 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 48f0ec65dc..f5729f36eb 100644 --- a/test/templates_test.rb +++ b/test/templates_test.rb @@ -101,6 +101,15 @@ def with_default_layout assert_equal "