Sha256: 960a9f64a814ba1c7109653edebd77a9171bb061204d7e55f4ffd789d6e620ab
Contents?: true
Size: 561 Bytes
Versions: 16
Compression:
Stored size: 561 Bytes
Contents
module Formstrap module Pagination def paginate(collection) @records_filtered = collection.count if collection.is_a?(Array) Kaminari.paginate_array(collection).page(page).per(per_page) else collection.page(page).per(per_page) end end def page if params[:page] params[:page] elsif params[:start] (params[:start].to_i / per_page) + 1 else 1 end end def per_page length = params[:per_page].to_i (length > 0) ? length : 24 end end end
Version data entries
16 entries across 16 versions & 1 rubygems