Sha256: 4147c13da2731f48588d1e720c59adcb918c787fc4b47920bd8025109e9aa1a4

Contents?: true

Size: 461 Bytes

Versions: 3

Compression:

Stored size: 461 Bytes

Contents

module PaginatedTable
  module ControllerHelpers
    def paginated_table(name, collection, options = {})
      defaults = options.fetch(:defaults, {})
      page = PageParams.create_page(params, defaults)
      data_page = DataPage.new(collection, page)
      instance_variable_set(:"@#{name}", data_page)
      render :partial => name, :layout => false if request.xhr?
    end
  end
end

ActionController::Base.send :include, PaginatedTable::ControllerHelpers

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
paginated_table-0.0.6 lib/paginated_table/controller_helpers.rb
paginated_table-0.0.5 lib/paginated_table/controller_helpers.rb
paginated_table-0.0.4 lib/paginated_table/controller_helpers.rb