From c88f2b5e23b0cb6c1a3b3687958f45d518414041 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 8 Jun 2008 20:35:14 -0700 Subject: with_output_buffer returns the temporary buffer instead of the result of the block --- actionpack/lib/action_view/helpers/capture_helper.rb | 1 + actionpack/test/template/tag_helper_test.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb index ab453fadf2..9cd9d3d06a 100644 --- a/actionpack/lib/action_view/helpers/capture_helper.rb +++ b/actionpack/lib/action_view/helpers/capture_helper.rb @@ -123,6 +123,7 @@ module ActionView def with_output_buffer(buf = '') self.output_buffer, old_buffer = buf, output_buffer yield + output_buffer ensure self.output_buffer = old_buffer end diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb index bfdaf0d639..2941dfe217 100644 --- a/actionpack/test/template/tag_helper_test.rb +++ b/actionpack/test/template/tag_helper_test.rb @@ -45,6 +45,7 @@ class TagHelperTest < ActionView::TestCase end def test_content_tag_with_block_and_options_outside_of_action_view + self.output_buffer = nil assert_equal content_tag("a", "Create", :href => "create"), content_tag("a", "href" => "create") { "Create" } end -- cgit v1.2.3