aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb12
1 files changed, 8 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 7c85441c5d..36a7e24011 100644
--- a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
+++ b/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
@@ -2,8 +2,6 @@ module ActionView
module Helpers
module Tags
class CollectionCheckBoxes < CollectionRadioButtons
- delegate :check_box, :label, :to => :@template_object
-
def render
rendered_collection = render_collection do |value, text, default_html_options|
default_html_options[:multiple] = true
@@ -11,8 +9,8 @@ module ActionView
if block_given?
yield sanitize_attribute_name(value), text, value, default_html_options
else
- check_box(@object_name, @method_name, default_html_options, value, nil) +
- label(@object_name, sanitize_attribute_name(value), text, :class => "collection_check_boxes")
+ check_box(value, default_html_options) +
+ label(value, text, "collection_check_boxes")
end
end
@@ -22,6 +20,12 @@ module ActionView
rendered_collection + hidden
end
+
+ private
+
+ def check_box(value, html_options)
+ @template_object.check_box(@object_name, @method_name, html_options, value, nil)
+ end
end
end
end