app/models/data_table_adapter.rb
# From the request params, extracts out all data required for building upon
# the base query.
From the request params, extracts out all data required for building upon
the base query.
From the request params extracts out all data required for building upon the base query .
def parse_request_params
    @column_names = []
    @searchable_column_names = []
    @request_params[:columns].map {|i| i[1]}.each do |column|
      @column_names << column[:data]
      @searchable_column_names << column[:data] if column[:searchable]
    end
    @search_value = @request_params[:search][:value].presence
    @orders = []
    @request_params[:order].map {|i| i[1]}.each do |order|
      @orders << "#{@column_names[order[:column].to_i]} #{order[:dir]}"
    end
    @start = @request_params[:start]
    @length = @request_params[:length]
  end
def parse_request_params @column_names = [ ] @searchable_column_names = [ ] @request_params [ :columns ] . map { | i | i [ 1 ] } . each do | column | @column_names << column [ :data ] @searchable_column_names << column [ :data ] if column [ :searchable ] end @search_value = @request_params [ :search ] [ :value ] . presence @orders = [ ] @request_params [ :order ] . map { | i | i [ 1 ] } . each do | order | @orders << "#{@column_names[order[:column].to_i]} #{order[:dir]}" end @start = @request_params [ :start ] @length = @request_params [ :length ] end
From the request params, extracts out all data required for building upon
the base query.
From the request params extracts out all data required for building upon the base query .