From 687bf4c434b703916c55349704103a459668e4e0 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Fri, 4 Jul 2008 13:49:39 +0100 Subject: [PATCH] Extend support for form_for/fields_for :index option (from 0da2aa6) to cover select and date helpers --- actionpack/lib/action_view/helpers/date_helper.rb | 6 +++--- .../lib/action_view/helpers/form_options_helper.rb | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index d018034..53a705b 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -708,15 +708,15 @@ module ActionView class FormBuilder def date_select(method, options = {}, html_options = {}) - @template.date_select(@object_name, method, options.merge(:object => @object), html_options) + @template.date_select(@object_name, method, objectify_options(options), html_options) end def time_select(method, options = {}, html_options = {}) - @template.time_select(@object_name, method, options.merge(:object => @object), html_options) + @template.time_select(@object_name, method, objectify_options(options), html_options) end def datetime_select(method, options = {}, html_options = {}) - @template.datetime_select(@object_name, method, options.merge(:object => @object), html_options) + @template.datetime_select(@object_name, method, objectify_options(options), html_options) 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 ab9e174..d318e16 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -445,19 +445,19 @@ module ActionView class FormBuilder def select(method, choices, options = {}, html_options = {}) - @template.select(@object_name, method, choices, options.merge(:object => @object), html_options) + @template.select(@object_name, method, choices, options.merge(:object => @object), html_options.reverse_merge(@default_options)) end def collection_select(method, collection, value_method, text_method, options = {}, html_options = {}) - @template.collection_select(@object_name, method, collection, value_method, text_method, options.merge(:object => @object), html_options) + @template.collection_select(@object_name, method, collection, value_method, text_method, options.merge(:object => @object), html_options.reverse_merge(@default_options)) end def country_select(method, priority_countries = nil, options = {}, html_options = {}) - @template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options) + @template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options.reverse_merge(@default_options)) end def time_zone_select(method, priority_zones = nil, options = {}, html_options = {}) - @template.time_zone_select(@object_name, method, priority_zones, options.merge(:object => @object), html_options) + @template.time_zone_select(@object_name, method, priority_zones, options.merge(:object => @object), html_options.reverse_merge(@default_options)) end end end -- 1.5.4.5