aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Mota <jose@josemota.net>2013-01-14 16:56:44 +0000
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-21 22:02:02 -0200
commitee82ce78296a6ed9c882ca6e0560cbbffe701824 (patch)
treef09a58e7b255ca15d5c6d78a77e03139801100e8 /actionpack/lib
parent351b0d90922dced4746eb445f243fea221e8114f (diff)
downloadrails-ee82ce78296a6ed9c882ca6e0560cbbffe701824.tar.gz
rails-ee82ce78296a6ed9c882ca6e0560cbbffe701824.tar.bz2
rails-ee82ce78296a6ed9c882ca6e0560cbbffe701824.zip
Capture block so content won't leak.
The [following pull request](https://github.com/rails/rails/pull/8916) fixed the block being passed to the appropriate helper method. However, the content being passed into the block is generating repeated markup on the page due to some weird ERb evaluation. This commit tries to capture the block's generated output so the page isn't flooded with markup. [Rafael França + José Mota] Closes #8936
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb4
-rw-r--r--actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb b/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
index d27df45b5a..9655008fe2 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
+++ b/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
@@ -13,13 +13,13 @@ module ActionView
end
end
- def render
+ def render(&block)
rendered_collection = render_collection do |item, value, text, default_html_options|
default_html_options[:multiple] = true
builder = instantiate_builder(CheckBoxBuilder, item, value, text, default_html_options)
if block_given?
- yield builder
+ @template_object.capture(builder, &block)
else
render_component(builder)
end
diff --git a/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb b/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
index 81f2ecb2b3..893f4411e7 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
+++ b/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
@@ -13,12 +13,12 @@ module ActionView
end
end
- def render
+ def render(&block)
render_collection do |item, value, text, default_html_options|
builder = instantiate_builder(RadioButtonBuilder, item, value, text, default_html_options)
if block_given?
- yield builder
+ @template_object.capture(builder, &block)
else
render_component(builder)
end