Sha256: dceb76e307e5f6c881ca9e267dcfeb4b052600f161321f2e0afa3dff22788c95

Contents?: true

Size: 729 Bytes

Versions: 6

Compression:

Stored size: 729 Bytes

Contents

module Uberkit::Forms::Helper
  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
  
  def uberform_for(name_or_object_or_array, *args, &proc)
    args = parse_options(*args)
    form_for(name_or_object_or_array, *args, &proc)
  end
  
  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
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
mbleigh-uberkit-0.0.3 lib/uberkit/forms/helper.rb
mbleigh-uberkit-0.0.4 lib/uberkit/forms/helper.rb
uberkit-0.0.10 lib/uberkit/forms/helper.rb
uberkit-0.0.9 lib/uberkit/forms/helper.rb
uberkit-0.0.8 lib/uberkit/forms/helper.rb
uberkit-0.0.7 lib/uberkit/forms/helper.rb