Module: ActiveAdmin::Inputs::Filters::Base
- Extended by:
- ActiveSupport::Autoload
- Included in:
- BooleanInput, CheckBoxesInput, DatePickerInput, DateRangeInput, NumericInput, SelectInput, StringInput, TextInput
- Defined in:
- lib/active_admin/inputs/filters/base.rb,
lib/active_admin/inputs/filters/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, #scope?, #searchable_has_many_through?, #seems_searchable?
Instance Method Details
#collection_from_options ⇒ Object
Override the standard finder to accept a proc
33 34 35 36 37 38 39 |
# File 'lib/active_admin/inputs/filters/base.rb', line 33 def if [:collection].is_a?(Proc) template.instance_exec(&[:collection]) else super end end |
#input_wrapping(&block) ⇒ Object
11 12 13 |
# File 'lib/active_admin/inputs/filters/base.rb', line 11 def input_wrapping(&block) template.content_tag :div, template.capture(&block), end |
#label_from_options ⇒ Object
Can pass proc to filter label option
20 21 22 23 24 |
# File 'lib/active_admin/inputs/filters/base.rb', line 20 def res = super res = res.call if res.is_a? Proc res end |
#required? ⇒ Boolean
15 16 17 |
# File 'lib/active_admin/inputs/filters/base.rb', line 15 def required? false end |
#wrapper_html_options ⇒ Object
26 27 28 29 30 |
# File 'lib/active_admin/inputs/filters/base.rb', line 26 def opts = super (opts[:class] ||= '') << " filter_form_field filter_#{as}" opts end |