Commit 2a43d66092b85b573e472b5b45f29c1224660e9d
1 parent
9ba90ad5
Exists in
master
and in
21 other branches
Added previous page and next page
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
lib/searchkick/results.rb
... | ... | @@ -84,6 +84,14 @@ module Searchkick |
84 | 84 | current_page * per_page |
85 | 85 | end |
86 | 86 | |
87 | + def previous_page | |
88 | + current_page > 1 ? (current_page - 1) : nil | |
89 | + end | |
90 | + | |
91 | + def next_page | |
92 | + current_page < total_pages ? (current_page + 1) : nil | |
93 | + end | |
94 | + | |
87 | 95 | protected |
88 | 96 | |
89 | 97 | def hits | ... | ... |