diff options
author | Marcel Molina <marcel@vernix.org> | 2006-04-25 19:38:52 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2006-04-25 19:38:52 +0000 |
commit | 5d61d2336cceebf388369f22fa4cfbc07983bde5 (patch) | |
tree | d83b6ac97d5299ada2d31099616dc15d9c0b59f5 /actionpack/lib/action_view/helpers/date_helper.rb | |
parent | 7a01561a6e2ac7e5ab0117d5099a7040a9324202 (diff) | |
download | rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.tar.gz rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.tar.bz2 rails-5d61d2336cceebf388369f22fa4cfbc07983bde5.zip |
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
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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)) |