Fix exception when the page is empty during sequential pagination. Caused because the paginator can't figure out the next or previous page when the current page is empty. * https://danbooru.donmai.us/posts?page=b0 * https://danbooru.donmai.us/posts?page=a10000000
14 lines
404 B
Plaintext
14 lines
404 B
Plaintext
<%# collection %>
|
|
|
|
<% content_for(:html_header) do %>
|
|
<% if collection.try(:records).present? %>
|
|
<% if collection.try(:prev_page) %>
|
|
<%= tag.link rel: "prev", href: url_for(nav_params_for(collection.prev_page)) %>
|
|
<% end %>
|
|
|
|
<% if collection.try(:next_page) %>
|
|
<%= tag.link rel: "next", href: url_for(nav_params_for(collection.next_page)) %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|