Sha256: 880f53dc324d1072285a04e25ebae83cb4479cb57884161d7ccebc9e6100dd80
Contents?: true
Size: 585 Bytes
Versions: 16
Compression:
Stored size: 585 Bytes
Contents
module TableSortable class QueryParams attr_reader :page, :page_size def initialize(params, columns, column_offset = 0) @page = params[PAGE].to_i @page_size = params[PAGESIZE].to_i # reset column filters and sorters columns.each do |col| col_index = (columns.find_index(col) + column_offset) col.filter.query = params[FCOL] ? params[FCOL][col_index.to_s] : nil col.sorter.sort_order = params[SCOL] && params[SCOL][col_index.to_s] ? ((params[SCOL][col_index.to_s] == SORT_ASC) ? :asc : :desc) : nil end end end end
Version data entries
16 entries across 16 versions & 1 rubygems