Class: ActiveAdmin::Inputs::FilterCheckBoxesInput

Inherits:
Formtastic::Inputs::CheckBoxesInput
  • Object
show all
Includes:
FilterBase
Defined in:
lib/active_admin/inputs/filter_check_boxes_input.rb

Instance Method Summary collapse

Methods included from FilterBase

#collection_from_options, #humanized_method_name, #input_wrapping, #reflection_for, #required?, #wrapper_html_options

Instance Method Details

#choice_label(choice) ⇒ Object

Add whitespace before label



15
16
17
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 15

def choice_label(choice)
  " #{super(choice)}"
end

#choice_wrapping(html_options, &block) ⇒ Object

Don’t wrap in LI tag



25
26
27
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 25

def choice_wrapping(html_options, &block)
  template.capture(&block)
end

#choices_group_wrapping(&block) ⇒ Object

Don’t wrap in UL tag



20
21
22
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 20

def choices_group_wrapping(&block)
  template.capture(&block)
end

#hidden_field_for_allObject

Don’t render hidden fields



30
31
32
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 30

def hidden_field_for_all
  ""
end

#hidden_fields?Boolean

Don’t render hidden fields

Returns:

  • (Boolean)


35
36
37
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 35

def hidden_fields?
  false
end

#input_nameObject



6
7
8
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 6

def input_name
  "#{object_name}[#{association_primary_key || method}_in][]"
end

#selected_valuesObject



10
11
12
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 10

def selected_values
  @object.send("#{association_primary_key || method}_in") || []
end