Sha256: f4aafc6d6d112d9289eea53b59ff7dc0508806a338ae26adce33a425d3b331c6

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

module SimpleForm
  module Inputs
    class DateTimeInput < Base
      def input
        @builder.send(:"#{input_type}_select", attribute_name, input_options, input_html_options)
      end

      private

      def has_required?
        false
      end

      def label_target
        case input_type
        when :date, :datetime
          "#{attribute_name}_1i"
        when :time
          "#{attribute_name}_4i"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_form-1.5.2 lib/simple_form/inputs/date_time_input.rb
simple_form-1.5.1 lib/simple_form/inputs/date_time_input.rb
simple_form-1.5.0 lib/simple_form/inputs/date_time_input.rb