1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

More readability

This commit is contained in:
Satoshi Ohmori 2015-08-27 22:11:51 +09:00
parent 1eb1643fb1
commit 3edef61ac3

View file

@ -116,11 +116,11 @@ module Kaminari::Helpers
param_name = options.delete(:param_name) || Kaminari.config.param_name
placeholder = options.delete(:placeholder)
unless scope.first_page?
if scope.first_page?
placeholder.to_s.html_safe
else
query = params.merge(param_name => scope.prev_page)
link_to name, env['PATH_INFO'] + (query.empty? ? '' : "?#{query.to_query}"), options.reverse_merge(:rel => 'previous')
else
placeholder.to_s.html_safe
end
end
@ -146,11 +146,11 @@ module Kaminari::Helpers
param_name = options.delete(:param_name) || Kaminari.config.param_name
placeholder = options.delete(:placeholder)
unless scope.last_page? || scope.out_of_range?
if scope.last_page? || scope.out_of_range?
placeholder.to_s.html_safe
else
query = params.merge(param_name => scope.next_page)
link_to name, env['PATH_INFO'] + (query.empty? ? '' : "?#{query.to_query}"), options.reverse_merge(:rel => 'next')
else
placeholder.to_s.html_safe
end
end
end