diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-31 17:46:31 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-02-02 09:40:23 -0200 |
commit | 21eba34718660b96b45cbb594d557b7e84bfed4f (patch) | |
tree | 8f6d590dfe9077708ac823e2494a9740adf2d267 /actionpack/lib/action_view/helpers/form_collections_helper.rb | |
parent | 15206885eb58978465e5f79a4f20cc3c3766de10 (diff) | |
download | rails-21eba34718660b96b45cbb594d557b7e84bfed4f.tar.gz rails-21eba34718660b96b45cbb594d557b7e84bfed4f.tar.bz2 rails-21eba34718660b96b45cbb594d557b7e84bfed4f.zip |
Add collection_radio_buttons and collection_check_boxes to FormBuilder
[Carlos Antonio da Silva + Rafael Mendonça França]
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_collections_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_collections_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_collections_helper.rb b/actionpack/lib/action_view/helpers/form_collections_helper.rb index 27b214f34c..9280902e7c 100644 --- a/actionpack/lib/action_view/helpers/form_collections_helper.rb +++ b/actionpack/lib/action_view/helpers/form_collections_helper.rb @@ -9,5 +9,15 @@ module ActionView Tags::CollectionCheckBoxes.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block) end end + + class FormBuilder + def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}) + @template.collection_radio_buttons(@object_name, method, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options)) + end + + def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}) + @template.collection_check_boxes(@object_name, method, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options)) + end + end end end |