aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tags/time_field.rb
blob: 271dc00c54810d0f1ebb218d6c80d04a5aaf4ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module ActionView
  module Helpers
    module Tags
      class TimeField < TextField #:nodoc:
        def render
          options = @options.stringify_keys
          options["value"] = @options.fetch("value") { value(object).try(:strftime, "%T.%L") }
          @options = options
          super
        end
      end
    end
  end
end