Module: Admin::SearchHelper

Defined in:
app/helpers/admin/search_helper.rb

Defined Under Namespace

Classes: FormBuilder

Instance Method Summary collapse

Instance Method Details

#search_form(path = url_for(action: :index), &block) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/helpers/admin/search_helper.rb', line 31

def search_form(path = url_for(action: :index), &block)
  (:div, class: 'well') do
    form_for @q, url: path, method: :get, style: 'margin-top: 20px;', builder: Admin::SearchHelper::FormBuilder do |f|
      [
        hidden_field_tag(:sort_by, params[:sort_by]),
        hidden_field_tag(:sort_direction, params[:sort_direction]),
        search_form_content(f, &block),
        search_form_submit_button,
        search_form_cancel_button(path)
      ].join.html_safe
    end
  end
end