Sha256: 38b806a2fca27847ef6b5a097f1b4d4bd72ba2c82fb49578ea15a2619ee33f00

Contents?: true

Size: 337 Bytes

Versions: 5

Compression:

Stored size: 337 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

5 entries across 5 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.12.11 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-1.12.10 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-1.12.9 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-1.12.8 app/controllers/concerns/comfy/paginate.rb
comfortable_mexican_sofa-1.12.7 app/controllers/concerns/comfy/paginate.rb