Fixed paging so that it won't fail if the necessary methods are missing on the result...
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 21 Mar 2014 20:51:39 +0000 (16:51 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 21 Mar 2014 20:51:39 +0000 (16:51 -0400)
apps/workbench/app/views/application/_paging.html.erb

index 463e65a81487a31fdd7e2fd8b0c5f9c26e523af7..df9d08d778c997fb641600eecb70c87fddb59ed1 100644 (file)
@@ -11,7 +11,13 @@ min-width: 1.2em;
 }
 <% end %>
 
-<% if results.result_offset != nil and results.result_limit != nil and results.items_available != nil %>
+<% if results.respond_to? :result_offset and
+       results.respond_to? :result_limit and
+       results.respond_to? :items_available and
+       results.result_offset != nil and
+       results.result_limit != nil and
+       results.items_available != nil 
+%>
 <div class="index-paging">
   Displaying <%= results.result_offset+1 %> &ndash; 
   <%= if results.result_offset + results.result_limit > results.items_available