Module: Uberkit::Forms::Helper

Defined in:
lib/uberkit/forms/helper.rb

Instance Method Summary collapse

Instance Method Details

#parse_options(*args) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/uberkit/forms/helper.rb', line 2

def parse_options(*args)
  options = args.extract_options!
  options.merge!(:builder => Uberkit::Forms::Builder)
  options[:html] ||= {}
  class_names = options[:html][:class] ? options[:html][:class].split(" ") : []
  class_names << "uberform"
  class_names << options.delete(:kind).to_s
  options[:html][:class] = class_names.join(" ")
  args << options
end

#remote_uberform_for(name_or_object_or_array, *args, &proc) ⇒ Object



18
19
20
21
# File 'lib/uberkit/forms/helper.rb', line 18

def remote_uberform_for(name_or_object_or_array, *args, &proc)
  args = parse_options(*args)
  remote_form_for(name_or_object_or_array, *args, &proc)
end

#uberform_for(name_or_object_or_array, *args, &proc) ⇒ Object



13
14
15
16
# File 'lib/uberkit/forms/helper.rb', line 13

def uberform_for(name_or_object_or_array, *args, &proc)
  args = parse_options(*args)
  form_for(name_or_object_or_array, *args, &proc)
end