don't add next page link if current page is out of range
This commit is contained in:
parent
f0ac0daf6a
commit
fdf4f0fc08
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ module API
|
|||
links << %(<#{request_url}?#{request_params.to_query}>; rel="prev") unless paginated_data.first_page?
|
||||
|
||||
request_params[:page] = paginated_data.current_page + 1
|
||||
links << %(<#{request_url}?#{request_params.to_query}>; rel="next") unless paginated_data.last_page?
|
||||
links << %(<#{request_url}?#{request_params.to_query}>; rel="next") unless paginated_data.last_page? || paginated_data.out_of_range?
|
||||
|
||||
request_params[:page] = 1
|
||||
links << %(<#{request_url}?#{request_params.to_query}>; rel="first")
|
||||
|
|
Loading…
Reference in a new issue