From 9323fb60572815fc63fa618a5bd17b68cf8c8e35 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 31 Jan 2012 15:45:59 -0200 Subject: Create collection_radio_buttons 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 | 31 ++-- .../helpers/tags/collection_radio_buttons.rb | 85 ++++++++++ .../test/template/form_collections_helper_test.rb | 174 +++++++++++++++++++++ 4 files changed, 279 insertions(+), 15 deletions(-) create mode 100644 actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb create mode 100644 actionpack/test/template/form_collections_helper_test.rb (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index c4cdfef4a2..5ca2f2abdc 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -191,6 +191,10 @@ module ActionView Tags::CollectionSelect.new(object, method, self, collection, value_method, text_method, options, html_options).render end + def collection_radio_buttons(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block) + Tags::CollectionRadioButtons.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block) + end + # Returns