Class: ActiveAdmin::Inputs::Filters::CheckBoxesInput
- Inherits:
-
Formtastic::Inputs::CheckBoxesInput
- Object
- Formtastic::Inputs::CheckBoxesInput
- ActiveAdmin::Inputs::Filters::CheckBoxesInput
- Includes:
- Base
- Defined in:
- lib/active_admin/inputs/filters/check_boxes_input.rb
Instance Method Summary collapse
-
#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 Base
#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?, #reflection_for, #scope?, #searchable_has_many_through?, #seems_searchable?
Methods included from Formtastic::Inputs::Base
Instance Method Details
#choice_wrapping(html_options, &block) ⇒ Object
Don’t wrap in LI tag
30 31 32 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 30 def choice_wrapping(, &block) template.capture(&block) end |
#choices_group_wrapping(&block) ⇒ Object
Don’t wrap in UL tag
25 26 27 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 25 def choices_group_wrapping(&block) template.capture(&block) end |
#hidden_field_for_all ⇒ Object
Don’t render hidden fields
35 36 37 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 35 def hidden_field_for_all "" end |
#hidden_fields? ⇒ Boolean
Don’t render hidden fields
40 41 42 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 40 def hidden_fields? false end |
#input_name ⇒ Object
8 9 10 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 8 def input_name "#{object_name}[#{searchable_method_name}_in][]" end |
#searchable_method_name ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 16 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
12 13 14 |
# File 'lib/active_admin/inputs/filters/check_boxes_input.rb', line 12 def selected_values @object.public_send(:"#{searchable_method_name}_in") || [] end |