Module: RailsPaginate::Helpers::Array
- Defined in:
- lib/rails_paginate/helpers/array.rb
Overview
Array extension for create paginate collection
Instance Method Summary collapse
-
#paginate(*args) ⇒ Object
paginate with options.
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) = args. per_page = .delete(:per_page) page = .delete(:page) || 1 ::RailsPaginate::Collection.new(self, args.first || page, per_page) end |