class Ransack::Helpers::FormBuilder

def search_fields(name, args, block)

def search_fields(name, args, block)
  args << {} unless args.last.is_a?(Hash)
  args.last[:builder] ||= options[:builder]
  args.last[:parent_builder] = self
  options = args.extract_options!
  objects = args.shift
  objects ||= @object.send(name)
  objects = [objects] unless Array === objects
  name = "#{options[:object_name] || object_name}[#{name}]"
  objects.inject(ActiveSupport::SafeBuffer.new) do |output, child|
    output << @template.fields_for("#{name}[#{options[:child_index] ||
    nested_child_index(name)}]", child, options, &block)
  end
end