<% if relation.total_pages > 1 %>
<% if first_page = relation.first_page %> <%= link_to t('pager.first'), page_path(first_page, options), class: 'first' %> <% end %> <% if previous_page = relation.previous_page %> <%= link_to t('pager.previous'), page_path(previous_page, options), class: 'previous' %> <% end %> <% if less_pages %> ... <% end %> <% pages.each do |page| %> <% if relation.current_page == page %> <%= page %> <% else %> <%= link_to page, page_path(page, options), class: 'page' %> <% end %> <% end %> <% if more_pages %> ... <% end %> <% if next_page = relation.next_page %> <%= link_to t('pager.next'), page_path(next_page, options), class: 'next' %> <% end %> <% if last_page = relation.last_page %> <%= link_to t('pager.last'), page_path(last_page, options), class: 'last' %> <% end %>
<% end %>