diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-03 01:10:00 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-03 01:10:00 -0700 |
commit | f55ad960d22337d0d92a93724f1cc3ad45200836 (patch) | |
tree | 8a4d7010bde17bb6ef42b357412922aaefa8227e /actionpack | |
parent | 4d4c8e298f5396e6b8ace0a10d7f991594aace2d (diff) | |
download | rails-f55ad960d22337d0d92a93724f1cc3ad45200836.tar.gz rails-f55ad960d22337d0d92a93724f1cc3ad45200836.tar.bz2 rails-f55ad960d22337d0d92a93724f1cc3ad45200836.zip |
Stack @output_buffer for nested rendering
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/template_handlers/compilable.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template_handlers/compilable.rb b/actionpack/lib/action_view/template_handlers/compilable.rb index 25bd0fea7f..28c72172a0 100644 --- a/actionpack/lib/action_view/template_handlers/compilable.rb +++ b/actionpack/lib/action_view/template_handlers/compilable.rb @@ -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 @@ -125,4 +125,4 @@ module ActionView end end -end
\ No newline at end of file +end diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index d0ee93cf3f..8b3ddc7603 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -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')) |