]> git.openstreetmap.org Git - rails.git/commitdiff
Specify display_name and tag explicitly when generating pagination links
authorTom Hughes <tom@compton.nu>
Fri, 30 Nov 2007 01:27:14 +0000 (01:27 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 30 Nov 2007 01:27:14 +0000 (01:27 +0000)
as they don't always seem to be default correctly. Closes #561.

app/helpers/trace_helper.rb
app/views/trace/_trace_paging_nav.rhtml

index 3922ce2b335e483af82af455710a7f445f0935b1..e5397b0de244528212e8e38b34c7e59c7ae70156 100644 (file)
@@ -6,4 +6,12 @@ module TraceHelper
       return link_to(tag, :tag => tag, :display_name => @display_name, :page => nil)
     end
   end
       return link_to(tag, :tag => tag, :display_name => @display_name, :page => nil)
     end
   end
+
+  def link_to_page(page)
+    if @action == "mine"
+      return link_to(page, :tag => @tag, :page => page)
+    else
+      return link_to(page, :tag => @tag, :display_name => @display_name, :page => page)
+    end
+  end
 end
 end
index a7e752893dd15c7546507b3598a1c07dd1a1b062..fec83e3dac5f24d1bf9d92d0d0906583968978a1 100644 (file)
@@ -8,5 +8,5 @@ end %>
 of <%= @trace_pages.item_count %>)
 
 <% if @trace_pages.page_count > 1 %>
 of <%= @trace_pages.item_count %>)
 
 <% if @trace_pages.page_count > 1 %>
- | <%= pagination_links(@trace_pages) %>
+ | <%= pagination_links_each(@trace_pages, {}) { |n| link_to_page(n) } %>
 <% end %>
 <% end %>