Class: ActiveAdmin::Inputs::FilterCheckBoxesInput
- Inherits:
-
Formtastic::Inputs::CheckBoxesInput
- Object
- Formtastic::Inputs::CheckBoxesInput
- ActiveAdmin::Inputs::FilterCheckBoxesInput
- Includes:
- FilterBase
- Defined in:
- lib/active_admin/inputs/filter_check_boxes_input.rb
Instance Method Summary collapse
-
#choice_label(choice) ⇒ Object
Add whitespace before label.
-
#choice_wrapping(html_options, &block) ⇒ Object
Don’t wrap in LI tag.
-
#choices_group_wrapping(&block) ⇒ Object
Don’t wrap in UL tag.
-
#hidden_field_for_all ⇒ Object
Don’t render hidden fields.
-
#hidden_fields? ⇒ Boolean
Don’t render hidden fields.
- #input_name ⇒ Object
- #selected_values ⇒ Object
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(, &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_all ⇒ Object
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
35 36 37 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 35 def hidden_fields? false end |
#input_name ⇒ Object
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_values ⇒ Object
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 |