Sha256: b7b68a2003b9657f2322fc1d679df215f628f8fc15c01f06fb2eca1026a4e3c1
Contents?: true
Size: 439 Bytes
Versions: 56
Compression:
Stored size: 439 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim # Common logic to paginate resources module Paginable extend ActiveSupport::Concern OPTIONS = [20, 50, 100].freeze included do helper_method :per_page def paginate(resources) resources.page(params[:page]).per(per_page) end def per_page params[:per_page] || OPTIONS.first end end end end
Version data entries
56 entries across 56 versions & 2 rubygems