Sha256: c3d8e28c8f5c3939e12dda0117de766f4dce4166e7c1b450eaf751de9de1f3cb

Contents?: true

Size: 439 Bytes

Versions: 14

Compression:

Stored size: 439 Bytes

Contents

module Fish0
  module Concerns
    module Paginatable
      extend ActiveSupport::Concern

      included do
        helper_method :page

        protected

        def page
          @page ||= (params[:page].to_i || 1)
        end

        def paginate(collection)
          Fish0::Paginator.new(collection, page_number: page, per_page: per_page).all
        end

        def per_page
          22
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fish0-0.0.14 lib/fish0/concerns/paginatable.rb
fish0-0.0.13 lib/fish0/concerns/paginatable.rb
fish0-0.0.12 lib/fish0/concerns/paginatable.rb
fish0-0.0.11 lib/fish0/concerns/paginatable.rb
fish0-0.0.10 lib/fish0/concerns/paginatable.rb
fish0-0.0.9 lib/fish0/concerns/paginatable.rb
fish0-0.0.8 lib/fish0/concerns/paginatable.rb
fish0-0.0.7 lib/fish0/concerns/paginatable.rb
fish0-0.0.6 lib/fish0/concerns/paginatable.rb
fish0-0.0.5 lib/fish0/concerns/paginatable.rb
fish0-0.0.4 lib/fish0/concerns/paginatable.rb
fish0-0.0.3 lib/fish0/concerns/paginatable.rb
fish0-0.0.2 lib/fish0/concerns/paginatable.rb
fish0-0.0.1 lib/fish0/concerns/paginatable.rb