aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-23 11:09:45 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-23 11:09:45 -0300
commit377641e90cbadc8ccd2d72e22862623072770aec (patch)
tree7e9100dee819e62d14f03b7f1c99a523c1266378 /actionview/lib/action_view/helpers/form_options_helper.rb
parent7ef29140eb67a8f1475ebde24c524d7ff35a2154 (diff)
parent57bf92c6de125adc45bb006115d22d07270618b3 (diff)
downloadrails-377641e90cbadc8ccd2d72e22862623072770aec.tar.gz
rails-377641e90cbadc8ccd2d72e22862623072770aec.tar.bz2
rails-377641e90cbadc8ccd2d72e22862623072770aec.zip
Merge pull request #11055 from bogdan/select-with-block
Ability to pass block to select form builder helper
Diffstat (limited to 'actionview/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_options_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb
index fcd151ac32..d9ccca8880 100644
--- a/actionview/lib/action_view/helpers/form_options_helper.rb
+++ b/actionview/lib/action_view/helpers/form_options_helper.rb
@@ -152,8 +152,8 @@ module ActionView
# In case if you don't want the helper to generate this hidden field you can specify
# <tt>include_hidden: false</tt> option.
#
- def select(object, method, choices, options = {}, html_options = {})
- Tags::Select.new(object, method, self, choices, options, html_options).render
+ def select(object, method, choices = nil, options = {}, html_options = {}, &block)
+ Tags::Select.new(object, method, self, choices, options, html_options, &block).render
end
# Returns <tt><select></tt> and <tt><option></tt> tags for the collection of existing return values of
@@ -766,8 +766,8 @@ module ActionView
# <% end %>
#
# Please refer to the documentation of the base helper for details.
- def select(method, choices, options = {}, html_options = {})
- @template.select(@object_name, method, choices, objectify_options(options), @default_options.merge(html_options))
+ def select(method, choices = nil, options = {}, html_options = {}, &block)
+ @template.select(@object_name, method, choices, objectify_options(options), @default_options.merge(html_options), &block)
end
# Wraps ActionView::Helpers::FormOptionsHelper#collection_select for form builders: