Module: Transit::FormHelper

Included in:
TransitHelper
Defined in:
app/helpers/transit/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#form_for(record_name_or_array, *args, &proc) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/transit/form_helper.rb', line 5

def form_for(record_name_or_array, *args, &proc)

  options = args.extract_options!
  options.reverse_merge!(:builder => Transit::Builders::FormBuilder)
  options[:html] ||= {}
  options[:html].merge!('data-js-validatable' => true) if options.delete(:validate)

  super(record_name_or_array, *(args << options), &proc)

end