From 7af0ec75d0d933d75f9a63a63bbbde554f206721 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 31 Jan 2012 16:31:17 -0200 Subject: Add collection_check_boxes helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Carlos Antonio da Silva + Rafael Mendonça França] --- .../lib/action_view/helpers/form_options_helper.rb | 4 + actionpack/lib/action_view/helpers/tags.rb | 1 + .../helpers/tags/collection_check_boxes.rb | 30 +++ .../test/template/form_collections_helper_test.rb | 228 ++++++++++++++++++++- 4 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 5ca2f2abdc..96519a7428 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -195,6 +195,10 @@ module ActionView Tags::CollectionRadioButtons.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block) end + def collection_check_boxes(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block) + Tags::CollectionCheckBoxes.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block) + end + # Returns