app/views/pagers/_main.html.erb in pagers-3.1.3 vs app/views/pagers/_main.html.erb in pagers-3.1.4
- old
+ new
@@ -3,30 +3,36 @@
<% if collection.previous_page %>
<li class="first">
<%= link_to t('pager.first'), page_path(collection.first_page, options) %>
</li>
<li class="previous">
- <%= link_to t('pager.previous'), page_path(collection.previous_page, options) %>
+ <%= link_to t('pager.previous'), page_path(collection.previous_page, options), rel: 'prev' %>
</li>
<% end %>
<% if less_pages %>
<li class="ellipsis">
…
</li>
<% end %>
<% pages.each do |page| %>
<li class="page<%= ' current' if collection.current_page == page %>">
- <%= link_to page, page_path(page, options) %>
+ <%=
+ link_to(
+ page,
+ page_path(page, options),
+ rel: (collection.next_page == page ? 'next' : collection.previous_page == page ? 'prev' : nil)
+ )
+ %>
</li>
<% end %>
<% if more_pages %>
<li class="ellipsis">
…
</li>
<% end %>
<% if collection.next_page %>
<li class="next">
- <%= link_to t('pager.next'), page_path(collection.next_page, options) %>
+ <%= link_to t('pager.next'), page_path(collection.next_page, options), rel: 'next' %>
</li>
<li class="last">
<%= link_to t('pager.last'), page_path(collection.last_page, options) %>
</li>
<% end %>