lib/jquery/gridify/grid_finder.rb
def params_to_rules(params)
      #debugger
      if params[:_search]=='true' || params[:_search]==true
        if params[:filters]
          # advanced search
          filters = ActiveSupport::JSON.decode(params[:filters])
          self.search_rules = filters['rules']
          self.search_rules_op = filters['groupOp']
        elsif params[:searchField]
          # simple search
          self.search_rules = [{"field" => params[:searchField], "op" => params[:searchOper], "data" => params[:searchString]}]
        else
          # toolbar search
          self.search_rules = []
          self.search_rules_op = :and
          colModel.each do |col|
            name = col.name
            data = params[name.to_sym]
            self.search_rules << {"field" => name, "op" => "cn", "data" => data} if data
          end
        end
      end
      search_rules
    end
def params_to_rules(params)
      #debugger
      if params[:_search]=='true' || params[:_search]==true
        if params[:filters]
          # advanced search
          filters = ActiveSupport::JSON.decode(params[:filters])
          self.search_rules = filters['rules']
          self.search_rules_op = filters['groupOp']
        elsif params[:searchField]
          # simple search
          self.search_rules = [{"field" => params[:searchField], "op" => params[:searchOper], "data" => params[:searchString]}]
        else
          # toolbar search
          self.search_rules = []
          self.search_rules_op = :and
          colModel.each do |col|
            name = col.name
            data = params[name.to_sym]
            self.search_rules << {"field" => name, "op" => "cn", "data" => data} if data
          end
        end
      end
      search_rules
    end
params[:filters] => {"groupOp"=>"AND",
              "rules"=>[{"data"=>"b", "op"=>"ge", "field"=>"title"}, {"data"=>"f", "op"=>"le", "field"=>"title"}] }