Module: RuoteKit::Helpers::PaginationHelpers
- Defined in:
- lib/ruote-kit/helpers/pagination_helpers.rb
Overview
Pagination stuff
Instance Method Summary collapse
-
#paginate ⇒ Object
Prerequesite : a @count var with the number of records (processes, workitems, errors or schedules) found.
Instance Method Details
#paginate ⇒ Object
Prerequesite : a @count var with the number of records (processes, workitems, errors or schedules) found.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruote-kit/helpers/pagination_helpers.rb', line 15 def paginate @skip = (params[:skip] || 0).to_i @limit = (params[:limit] || settings.limit).to_i if @skip <= 0 @skip = 0 elsif @skip >= @count @skip = @count - @limit end end |