From 5d61d2336cceebf388369f22fa4cfbc07983bde5 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Tue, 25 Apr 2006 19:38:52 +0000 Subject: Refactor various InstanceTag instance method to class methods. Closes #4800. [skaes@web.de] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/date_helper.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib/action_view/helpers/date_helper.rb') diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 0040095669..4920763b50 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -258,6 +258,7 @@ module ActionView defaults = { :discard_type => true } options = defaults.merge(options) options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } + value = value(object) date = options[:include_blank] ? (value || 0) : (value || Date.today) date_select = '' @@ -282,6 +283,7 @@ module ActionView defaults = { :discard_type => true } options = defaults.merge(options) options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } + value = value(object) datetime = options[:include_blank] ? (value || nil) : (value || Time.now) datetime_select = select_year(datetime, options_with_prefix.call(1)) -- cgit v1.2.3