Class: ActiveAdmin::Inputs::Filters::StringInput

Inherits:
Formtastic::Inputs::StringInput
  • Object
show all
Includes:
Base, Base::SearchMethodSelect
Defined in:
lib/active_admin/inputs/filters/string_input.rb

Instance Method Summary collapse

Methods included from Base::SearchMethodSelect

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

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

#input_wrapping

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.



13
14
15
16
17
18
19
20
21
22
# File 'lib/active_admin/inputs/filters/string_input.rb', line 13

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