Class: ActiveAdmin::FilterFormBuilder
- Inherits:
-
FormBuilder
- Object
- Formtastic::SemanticFormBuilder
- FormBuilder
- ActiveAdmin::FilterFormBuilder
- Defined in:
- lib/active_admin/view_helpers/filter_form_helper.rb
Overview
This form builder defines methods to build filter forms such as the one found in the sidebar of the index page of a standard resource.
Instance Attribute Summary
Attributes inherited from FormBuilder
Instance Method Summary collapse
Methods inherited from FormBuilder
#buttons, #cancel_link, #commit_button, #commit_button_with_cancel_link, #datepicker_input, #has_many, #initialize, #input, #inputs
Constructor Details
This class inherits a constructor from ActiveAdmin::FormBuilder
Instance Method Details
#filter(method, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/active_admin/view_helpers/filter_form_helper.rb', line 39 def filter(method, = {}) return "" if method.nil? || method == "" [:as] ||= default_filter_type(method) return "" unless [:as] field_type = .delete(:as) [:label] ||= default_filter_label(method) content = with_new_form_buffer do send("filter_#{field_type}_input", method, ) end @form_buffers.last << template.content_tag(:div, content, :class => "filter_form_field filter_#{field_type}") end |