Sha256: 603173e2a8310f06004576a8ccf57bc4d5639da074ff9a5fbe2cda877814899c

Contents?: true

Size: 332 Bytes

Versions: 10

Compression:

Stored size: 332 Bytes

Contents

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

10 entries across 10 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.12 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.11 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.10 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.9 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.8 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.7 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.6 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.5 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.4 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-2.0.3 app/controllers/concerns/comfy/paginate.rb