Class: ActiveAdmin::Inputs::FilterStringInput

Inherits:
Formtastic::Inputs::StringInput
  • Object
show all
Includes:
FilterBase, ActiveAdmin::Inputs::FilterBase::SearchMethodSelect
Defined in:
lib/active_admin/inputs/filter_string_input.rb

Instance Method Summary collapse

Methods included from ActiveAdmin::Inputs::FilterBase::SearchMethodSelect

#current_filter, #filter_options, #filters, #input_html, #select_html, #wrapper_html_options

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

#to_htmlObject

If the filter method includes a search condition, build a normal string search field. Else, build a search field with a companion dropdown to choose a search condition from.



11
12
13
14
15
16
17
18
19
20
# File 'lib/active_admin/inputs/filter_string_input.rb', line 11

def to_html
  if seems_searchable?
    input_wrapping do
      label_html <<
      builder.text_field(method, input_html_options)
    end
  else
    super # SearchMethodSelect#to_html
  end
end