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
- #searchable_method_name ⇒ Object
- #selected_values ⇒ Object
Methods included from FilterBase
#collection_from_options, #input_wrapping, #label_from_options, #required?, #wrapper_html_options
Methods included from Filters::FormtasticAddons
#column, #column_for, #has_predicate?, #humanized_method_name, #klass, #polymorphic_foreign_type?, #ransacker?, #reflection_for, #searchable_has_many_through?, #seems_searchable?
Instance Method Details
#choice_label(choice) ⇒ Object
Add whitespace before label
23 24 25 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 23 def choice_label(choice) ' ' + super end |
#choice_wrapping(html_options, &block) ⇒ Object
Don’t wrap in LI tag
33 34 35 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 33 def choice_wrapping(, &block) template.capture(&block) end |
#choices_group_wrapping(&block) ⇒ Object
Don’t wrap in UL tag
28 29 30 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 28 def choices_group_wrapping(&block) template.capture(&block) end |
#hidden_field_for_all ⇒ Object
Don’t render hidden fields
38 39 40 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 38 def hidden_field_for_all "" end |
#hidden_fields? ⇒ Boolean
Don’t render hidden fields
43 44 45 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 43 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}[#{searchable_method_name}_in][]" end |
#searchable_method_name ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 14 def searchable_method_name if searchable_has_many_through? "#{reflection.through_reflection.name}_#{reflection.foreign_key}" else association_primary_key || method end end |
#selected_values ⇒ Object
10 11 12 |
# File 'lib/active_admin/inputs/filter_check_boxes_input.rb', line 10 def selected_values @object.send("#{searchable_method_name}_in") || [] end |