Module: Formtastic::Helpers::InputHelper

Defined in:
lib/activeadmin_addons/support/set_datepicker.rb

Instance Method Summary collapse

Instance Method Details

#active_admin_context?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/activeadmin_addons/support/set_datepicker.rb', line 16

def active_admin_context?
  options[:builder] == ::ActiveAdmin::FormBuilder
rescue NameError
  false
end

#default_input_type(method, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/activeadmin_addons/support/set_datepicker.rb', line 6

def default_input_type(method, options = {})
  input_type = original_default_input_type(method, options)

  if input_type == :date_select && active_admin_context?
    input_type = :datepicker
  end

  input_type
end

#original_default_input_typeObject



4
# File 'lib/activeadmin_addons/support/set_datepicker.rb', line 4

alias_method :original_default_input_type, :default_input_type