<% if instance_variable_get("@newer_#{name}") -%>
  • <%= link_to t("newer_#{name}", :scope => scope), @params.merge(:after => instance_variable_get("@#{name}").first.id), :class => "page-link" %>
  • <% else -%>
  • <%= t("newer_#{name}", :scope => scope) %>
  • <% end -%> <% if instance_variable_get("@older_#{name}") -%>
  • <%= link_to t("older_#{name}", :scope => scope), @params.merge(:before => instance_variable_get("@#{name}").last.id), :class => "page-link" %>
  • <% else -%>
  • <%= t("older_#{name}", :scope => scope) %>
  • <% end -%>