views: factor out paginator component.
* Refactor the paginator into a ViewComponent.
* Fix inconsistent spacing between paginator items.
* Fix a bug where the sequential paginator generated the wrong next /
previous page links in the <link rel="{next|prev}"> tags in the <head>.
* Always include the final page as a hidden html element, so that it can
be unhidden with custom CSS.
* Make it easier to change the pagination window.
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
<%# collection %>
|
||||
|
||||
<% content_for(:html_header) do %>
|
||||
<% 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 %>
|
||||
Reference in New Issue
Block a user