aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-31 16:51:20 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-02-02 09:40:22 -0200
commit5c497262f3d0a1d3f754506894efca051162846d (patch)
tree145da0d7c12bd6adc53fdf536aee38140dd4decd /actionpack
parent7af0ec75d0d933d75f9a63a63bbbde554f206721 (diff)
downloadrails-5c497262f3d0a1d3f754506894efca051162846d.tar.gz
rails-5c497262f3d0a1d3f754506894efca051162846d.tar.bz2
rails-5c497262f3d0a1d3f754506894efca051162846d.zip
Move collection_check_boxes and collection_radio_buttons to they our
module [Carlos Antonio da Silva + Rafael Mendonça França]
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers.rb2
-rw-r--r--actionpack/lib/action_view/helpers/form_collections_helper.rb13
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb8
3 files changed, 15 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/helpers.rb b/actionpack/lib/action_view/helpers.rb
index f2a3a494bc..d47ec6eeb4 100644
--- a/actionpack/lib/action_view/helpers.rb
+++ b/actionpack/lib/action_view/helpers.rb
@@ -12,6 +12,7 @@ module ActionView #:nodoc:
autoload :CsrfHelper
autoload :DateHelper
autoload :DebugHelper
+ autoload :FormCollectionsHelper
autoload :FormHelper
autoload :FormOptionsHelper
autoload :FormTagHelper
@@ -42,6 +43,7 @@ module ActionView #:nodoc:
include CsrfHelper
include DateHelper
include DebugHelper
+ include FormCollectionsHelper
include FormHelper
include FormOptionsHelper
include FormTagHelper
diff --git a/actionpack/lib/action_view/helpers/form_collections_helper.rb b/actionpack/lib/action_view/helpers/form_collections_helper.rb
new file mode 100644
index 0000000000..27b214f34c
--- /dev/null
+++ b/actionpack/lib/action_view/helpers/form_collections_helper.rb
@@ -0,0 +1,13 @@
+module ActionView
+ module Helpers
+ module FormCollectionsHelper
+ 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
+
+ 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
+ end
+ end
+end
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index 96519a7428..c4cdfef4a2 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -191,14 +191,6 @@ 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
-
- 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 <tt><select></tt>, <tt><optgroup></tt> and <tt><option></tt> tags for the collection of existing return values of
# +method+ for +object+'s class. The value returned from calling +method+ on the instance +object+ will
# be selected. If calling +method+ returns +nil+, no selection is made without including <tt>:prompt</tt>