Sha256: 6c222996a817f05ceb847ee5029107553880b8ae93476aed80ada2398ef18031

Contents?: true

Size: 590 Bytes

Versions: 12

Compression:

Stored size: 590 Bytes

Contents

module ActiveAdmin
  module Inputs
    class DatepickerInput < ::Formtastic::Inputs::StringInput
      def input_html_options
        super.tap do |options|
          options[:class] = [options[:class], "datepicker"].compact.join(' ')
          options[:data] ||= {}
          options[:data].merge! datepicker_options
        end
      end

      private
      def datepicker_options
        options = self.options.fetch(:datepicker_options, {})
        options = Hash[options.map{ |k, v| [k.to_s.camelcase(:lower), v] }]
        { datepicker_options: options }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.3.1 lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.3.0 lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.2.1 lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.2.0 lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.1.0 lib/active_admin/inputs/datepicker_input.rb