aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-08 20:35:14 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-08 20:35:30 -0700
commitc88f2b5e23b0cb6c1a3b3687958f45d518414041 (patch)
tree9ca56019a073aea37fc5eda1b4735e1e21428425 /actionpack
parentdf44df945d6315238e7d94d9bdef82e435dc9b24 (diff)
downloadrails-c88f2b5e23b0cb6c1a3b3687958f45d518414041.tar.gz
rails-c88f2b5e23b0cb6c1a3b3687958f45d518414041.tar.bz2
rails-c88f2b5e23b0cb6c1a3b3687958f45d518414041.zip
with_output_buffer returns the temporary buffer instead of the result of the block
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/capture_helper.rb1
-rw-r--r--actionpack/test/template/tag_helper_test.rb1
2 files changed, 2 insertions, 0 deletions
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