1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
This commit is contained in:
Akira Matsuda 2016-11-23 11:36:06 +09:00
parent 63cf11cea4
commit da68ec985f

View file

@ -147,8 +147,7 @@ module Kaminari
#
# It will return `nil` if there is no next page.
def path_to_next_page(scope, options = {})
return unless scope.next_page
Kaminari::Helpers::NextPage.new(self, options.reverse_merge(current_page: scope.current_page)).url
Kaminari::Helpers::NextPage.new(self, options.reverse_merge(current_page: scope.current_page)).url if scope.next_page
end
# A helper that calculates the path to the previous page.
@ -161,8 +160,7 @@ module Kaminari
#
# It will return `nil` if there is no previous page.
def path_to_prev_page(scope, options = {})
return unless scope.prev_page
Kaminari::Helpers::PrevPage.new(self, options.reverse_merge(current_page: scope.current_page)).url
Kaminari::Helpers::PrevPage.new(self, options.reverse_merge(current_page: scope.current_page)).url if scope.prev_page
end
module PaginatorExtension