def fields_for(*args, &block)
      if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }
        args.unshift(:search) if args.first == search_obj
        options = args.extract_options!
        if !options[:skip_order_field]
          concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order), :style => "display: inline"))
        end
        args << options
        super
      else
        super
      end
    end
def fields_for(*args, &block)
      if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }
        args.unshift(:search) if args.first == search_obj
        options = args.extract_options!
        if !options[:skip_order_field]
          concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order), :style => "display: inline"))
        end
        args << options
        super
      else
        super
      end
    end
Automatically adds an "order" hidden field in your form to preserve how the data
 is being ordered.