Sha256: 98ae0e39d7f9cd8aaf2718e8605a76f7b55ed564d9d00e23c8e3cdda0f4dd754

Contents?: true

Size: 317 Bytes

Versions: 2

Compression:

Stored size: 317 Bytes

Contents

module Core
  module PaginatedController
    extend ActiveSupport::Concern

    included do
      def collection
        @search = end_of_association_chain.search(params[:search])
        get_collection_ivar || set_collection_ivar(@search.paginate(:page => params[:page], :per_page => 10))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
core-generators-0.0.2 lib/core/paginated_controller.rb
core-generators-0.0.1 lib/core/paginated_controller.rb