Sha256: dfd4641427c65cae37a12ddf291d567c112277d3f325b95a6c4122d7a9f6e886

Contents?: true

Size: 449 Bytes

Versions: 9

Compression:

Stored size: 449 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).to_collection
        end

        def per_page
          22
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
test_fish0-0.2.0 lib/fish0/concerns/paginatable.rb
fish0-0.2.0 lib/fish0/concerns/paginatable.rb
fish0-0.1.2 lib/fish0/concerns/paginatable.rb
fish0-0.1.1 lib/fish0/concerns/paginatable.rb
fish0-0.1.0 lib/fish0/concerns/paginatable.rb
fish0-0.0.18 lib/fish0/concerns/paginatable.rb
fish0-0.0.17 lib/fish0/concerns/paginatable.rb
fish0-0.0.16 lib/fish0/concerns/paginatable.rb
fish0-0.0.15 lib/fish0/concerns/paginatable.rb