aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/date_field.rb
blob: bb968e9f39e9cc0d8c5dfcb51c05d5e209670061 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module ActionView
  module Helpers
    module Tags
      class DateField < TextField #:nodoc:
        def render
          options = @options.stringify_keys
          options["value"] = @options.fetch("value") { value(object).try(:to_date) }
          options["size"] = nil
          @options = options
          super
        end
      end
    end
  end
end