Created
June 25, 2014 06:39
-
-
Save sidravic/9f909a0812de680dff77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kaminari.paginate_array([{:a => 1}, {:b => 2}, {:c => 3}, {:d => 4}]).page(1).per(1) | |
=> [{:a=>1}] | |
[10] pry(main)> Kaminari.paginate_array([{:a => [1,2,3,4]}, {:b => [123,123,1231,231]}, {:c => [123123]}, {:d => [:asd, :asdasd]}]).page(1).per(1) | |
=> [{:a=>[1, 2, 3, 4]}] | |
[11] pry(main)> Kaminari.paginate_array([{:a => [1,2,3,4]}, {:b => [123,123,1231,231]}, {:c => [123123]}, {:d => [:asd, :asdasd]}]).page(1).per(2) | |
=> [{:a=>[1, 2, 3, 4]}, {:b=>[123, 123, 1231, 231]}] | |
[12] pry(main)> Kaminari.paginate_array([{:a => [1,2,3,4]}, {:b => [123,123,1231,231]}, {:c => [123123]}, {:d => [:asd, :asdasd]}]).page(1).per(3) | |
=> [{:a=>[1, 2, 3, 4]}, {:b=>[123, 123, 1231, 231]}, {:c=>[123123]}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment