Module: ActiveAdmin::Inputs::FilterBase
- Extended by:
- ActiveSupport::Autoload
- Includes:
- Filters::FormtasticAddons, Formtastic::Inputs::Base
- Included in:
- FilterBooleanInput, FilterCheckBoxesInput, FilterDateRangeInput, FilterNumericInput, FilterSelectInput, FilterStringInput
- Defined in:
- lib/active_admin/inputs/filter_base.rb,
lib/active_admin/inputs/filter_base/search_method_select.rb
Defined Under Namespace
Modules: SearchMethodSelect
Instance Method Summary collapse
-
#collection_from_options ⇒ Object
Override the standard finder to accept a proc.
- #input_wrapping(&block) ⇒ Object
-
#label_from_options ⇒ Object
Can pass proc to filter label option.
- #required? ⇒ Boolean
- #wrapper_html_options ⇒ Object
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
#collection_from_options ⇒ Object
Override the standard finder to accept a proc
30 31 32 33 34 35 36 |
# File 'lib/active_admin/inputs/filter_base.rb', line 30 def if [:collection].is_a?(Proc) template.instance_exec(&[:collection]) else super end end |
#input_wrapping(&block) ⇒ Object
10 11 12 |
# File 'lib/active_admin/inputs/filter_base.rb', line 10 def input_wrapping(&block) template.content_tag :div, template.capture(&block), end |
#label_from_options ⇒ Object
Can pass proc to filter label option
19 20 21 22 23 |
# File 'lib/active_admin/inputs/filter_base.rb', line 19 def res = super res = res.call if res.is_a? Proc res end |
#required? ⇒ Boolean
14 15 16 |
# File 'lib/active_admin/inputs/filter_base.rb', line 14 def required? false end |
#wrapper_html_options ⇒ Object
25 26 27 |
# File 'lib/active_admin/inputs/filter_base.rb', line 25 def { class: "filter_form_field #{as}" } end |