<nav>
<ul class="pagination">
- <% if instance_variable_get("@newer_#{name}") -%>
+ <% if newer_id -%>
<li class="page-item">
- <%= link_to t("newer_#{name}", :scope => scope), @params.merge(:after => instance_variable_get("@#{name}").first.id), :class => "page-link" %>
+ <%= link_to t(newer_key), @params.merge(:after => newer_id), :class => "page-link" %>
</li>
<% else -%>
<li class="page-item disabled">
- <span class="page-link"><%= t("newer_#{name}", :scope => scope) %></span>
+ <span class="page-link"><%= t(newer_key) %></span>
</li>
<% end -%>
-
- <% if instance_variable_get("@older_#{name}") -%>
+
+ <% if older_id -%>
<li class="page-item">
- <%= link_to t("older_#{name}", :scope => scope), @params.merge(:before => instance_variable_get("@#{name}").last.id), :class => "page-link" %>
+ <%= link_to t(older_key), @params.merge(:before => older_id), :class => "page-link" %>
</li>
<% else -%>
<li class="page-item disabled">
- <span class="page-link"><%= t("older_#{name}", :scope => scope) %></span>
+ <span class="page-link"><%= t(older_key) %></span>
</li>
<% end -%>
</ul>