Rails: pagination with custom offset using Kaminari
问题 I'm using Kaminari for pagination and under a certain situation need the first page to contain only 2 entries while each other to have 6. Thought this was achievable using padding() , but it doesn't seem to work like I'd expect (the documentation doesn't help much either): a = (1..20).to_a b = Kaminari.paginate_array(a).page(1).per(6).padding(2) => [3, 4, 5, 6, 7, 8] Any ideas on how to accomplish this? 回答1: this might help you: a = (1..20).to_a b = Kaminari.paginate_array(a).page(1).per(6)