module ActiveAdmin::Inputs::Filters::Base

Public Instance Methods

collection_from_options() click to toggle source

Override the standard finder to accept a proc

Calls superclass method
# File lib/active_admin/inputs/filters/base.rb, line 33
def collection_from_options
  if options[:collection].is_a?(Proc)
    template.instance_exec(&options[:collection])
  else
    super
  end
end
input_wrapping(&block) click to toggle source
# File lib/active_admin/inputs/filters/base.rb, line 11
def input_wrapping(&block)
  template.content_tag :div, template.capture(&block), wrapper_html_options
end
label_from_options() click to toggle source

Can pass proc to filter label option

Calls superclass method
# File lib/active_admin/inputs/filters/base.rb, line 20
def label_from_options
  res = super
  res = res.call if res.is_a? Proc
  res
end
required?() click to toggle source
# File lib/active_admin/inputs/filters/base.rb, line 15
def required?
  false
end
wrapper_html_options() click to toggle source
Calls superclass method
# File lib/active_admin/inputs/filters/base.rb, line 26
def wrapper_html_options
  opts = super
  (opts[:class] ||= '') << " filter_form_field filter_#{as}"
  opts
end