Permalink
Browse files

Another small refactoring

  • Loading branch information...
yuki24 committed Feb 3, 2014
1 parent 0c2a7c0 commit 5e2e505cdd2ea2de20949d5cef261c247b3168b1
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/kaminari/helpers/action_view_extension.rb
@@ -39,7 +39,7 @@ def paginate(scope, options = {}, &block)
def link_to_previous_page(scope, name, options = {}, &block)
params = options.delete(:params) || {}
param_name = options.delete(:param_name) || Kaminari.config.param_name
- link_to_unless scope.first_page?, name, params.merge(param_name => (scope.current_page - 1)), options.reverse_merge(:rel => 'previous') do
+ link_to_unless scope.first_page?, name, params.merge(param_name => scope.prev_page), options.reverse_merge(:rel => 'previous') do
block.call if block
end
end
@@ -64,7 +64,7 @@ def link_to_previous_page(scope, name, options = {}, &block)
def link_to_next_page(scope, name, options = {}, &block)
params = options.delete(:params) || {}
param_name = options.delete(:param_name) || Kaminari.config.param_name
- link_to_unless scope.last_page?, name, params.merge(param_name => (scope.current_page + 1)), options.reverse_merge(:rel => 'next') do
+ link_to_unless scope.last_page?, name, params.merge(param_name => scope.next_page), options.reverse_merge(:rel => 'next') do
block.call if block
end
end

0 comments on commit 5e2e505

Please sign in to comment.