Module: RansackSimpleForm::FormHelper

Defined in:
lib/ransack_simple_form.rb

Instance Method Summary collapse

Instance Method Details

#ransack_simple_form_for(*args, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ransack_simple_form.rb', line 7

def ransack_simple_form_for(*args, &block)
  opts = args.extract_options!
  opts[:builder] = FormBuilder

  # add the default form class
  # (works whether existing class is a String like
  # "foo bar" or an Array like ["foo", "bar"])
  opts[:html] ||= {}
  opts[:html][:class] ||= []
  opts[:html][:class] << ' ' if opts[:html][:class].is_a? String
  opts[:html][:novalidate] ||= true

  search_form_for(*args, opts, &block)
end