Module: FilterForm::FormHelper

Defined in:
lib/filter_form/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#filter_form_for(record, options = {}, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/filter_form/form_helper.rb', line 3

def filter_form_for(record, options = {}, &block)
  options.reverse_merge!({
    url:    url_for,
    method: :get,
    html:   { class: 'filter_form', novalidate: true }
  })

  record.instance_eval do
    def model_name
      klass.model_name
    end
  end

  simple_form_for(record, options, &block)
end