3

I need to implement some logic for to show 3 elements on the first page and by 1 element on all the next. For the first page there is no problems:

items = @model.limit(@first_page_items)

and for all the next ones i tried:

@model.offset(@first_page_items).page(@current_page - 1).per(@per) #makes no offset at all - all the items going from the beginning
@model.page(@current_page - 1).per(@per).offset(@first_page_items) #produces 4-th element on the second page and stays on it for ever

What am I doing wrong? thx

sandric
  • 2,310
  • 3
  • 21
  • 26
  • Oh, Im stupid, sorry, already found - padding method - Kaminari::PageScopeMethods::padding(num), on the case if anyone will having the same issue – sandric Jan 13 '13 at 17:36

0 Answers0