Sha256: 393e8c6a28e5390a1fac5c88ce66737467c2ad6176f68cd7eee842ea39f08621

Contents?: true

Size: 363 Bytes

Versions: 17

Compression:

Stored size: 363 Bytes

Contents

# frozen_string_literal: true

module Comfy::Paginate

  # Wrapper to deal with WillPaginate vs Kaminari nonsense
  def comfy_paginate(scope, per_page: 50)
    if defined?(WillPaginate)
      scope.paginate(page: params[:page], per_page: per_page)
    elsif defined?(Kaminari)
      scope.page(params[:page]).per(per_page)
    else
      scope
    end
  end

end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
comfortable_mexican_sofa-2.0.19 app/controllers/concerns/comfy/paginate.rb
PixelForce_ETS-0.0.2 app/controllers/concerns/comfy/paginate.rb
PixelForce_ETS-0.0.1 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest2-0.0.4 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest2-0.0.3 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest2-0.0.2 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest2-0.0.1 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest-0.0.1 app/controllers/concerns/comfy/paginate.rb
kcyEtsTest-2.2.19 app/controllers/concerns/comfy/paginate.rb
ComfortableMexicanSofa-2.0.18 app/controllers/concerns/comfy/paginate.rb
kcy1-1.0 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.18 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.17 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.16 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.15 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.14 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.13 app/controllers/concerns/comfy/paginate.rb