]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/diary_entries/_pagination.html.erb
Don't interpolate in pagination partial
[rails.git] / app / views / diary_entries / _pagination.html.erb
index 63a0fc3e278ba697144158f4ddf3acfea5d42d6d..4a948a4f53378fee502a599bd475d609b344fb18 100644 (file)
@@ -1,22 +1,22 @@
 <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>