Module: RailsPaginate::Helpers::Array

Defined in:
lib/rails_paginate/helpers/array.rb

Overview

Array extension for create paginate collection

Instance Method Summary collapse

Instance Method Details

#paginate(*args) ⇒ Object

paginate with options

page = active page per_page = how much entries per page



8
9
10
11
12
13
# File 'lib/rails_paginate/helpers/array.rb', line 8

def paginate(*args)
  options = args.extract_options!
  per_page = options.delete(:per_page)
  page = options.delete(:page) || 1
  ::RailsPaginate::Collection.new(self, args.first || page, per_page)
end