Module: Formtastic::Helpers::InputHelper
- Defined in:
- lib/activeadmin_addons/support/set_datepicker.rb
Instance Method Summary collapse
- #active_admin_context? ⇒ Boolean
- #default_input_type(method, options = {}) ⇒ Object
- #original_default_input_type ⇒ Object
Instance Method Details
#active_admin_context? ⇒ Boolean
16 17 18 19 20 |
# File 'lib/activeadmin_addons/support/set_datepicker.rb', line 16 def active_admin_context? [: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, = {}) input_type = original_default_input_type(method, ) if input_type == :date_select && active_admin_context? input_type = :datepicker end input_type end |
#original_default_input_type ⇒ Object
4 |
# File 'lib/activeadmin_addons/support/set_datepicker.rb', line 4 alias_method :original_default_input_type, :default_input_type |