Sha256: 564480bbc564a91c6d7f46bfa3fa7024259f8ab0a8a6104e66f44e15c518075a

Contents?: true

Size: 600 Bytes

Versions: 32

Compression:

Stored size: 600 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

32 entries across 32 versions & 6 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.17.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.16.pre lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/inputs/datepicker_input.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.15.pre lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.0.0 lib/active_admin/inputs/datepicker_input.rb
activeadmin-1.0.0.pre5 lib/active_admin/inputs/datepicker_input.rb
activeadmin-orac-1.0.0.pre4 lib/active_admin/inputs/datepicker_input.rb
activeadmin-orac-1.0.0 lib/active_admin/inputs/datepicker_input.rb
activeadmin-orac-1.0.0.pre.orac lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.14.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.13.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.12.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.11.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.10.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.9.pre lib/active_admin/inputs/datepicker_input.rb
yousty-activeadmin-1.0.8.pre lib/active_admin/inputs/datepicker_input.rb