1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Stack @output_buffer for nested rendering

This commit is contained in:
Jeremy Kemper 2008-06-03 01:10:00 -07:00
parent 4d4c8e298f
commit f55ad960d2
2 changed files with 3 additions and 3 deletions

View file

@ -106,7 +106,7 @@ module ActionView
locals_code << "#{key} = local_assigns[:#{key}]\n"
end
"def #{render_symbol}(local_assigns)\n#{locals_code}#{body}\nend"
"def #{render_symbol}(local_assigns)\nold_output_buffer = @output_buffer;#{locals_code}#{body}\nensure\n@output_buffer = old_output_buffer\nend"
end
# Return true if the given template was compiled for a superset of the keys in local_assigns

View file

@ -512,7 +512,7 @@ class FragmentCachingTest < Test::Unit::TestCase
def test_cache_erb_fragment
@store.write('views/expensive', 'fragment content')
@controller.template.output_buffer = 'generated till now -> '
@controller.response.template.output_buffer = 'generated till now -> '
assert_equal( 'generated till now -> fragment content',
ActionView::TemplateHandlers::ERB.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))