X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/fa554045e57220a0e87c2cea2ea3e7309f78704a..62e7006a2131eef9f7569e8c25207b3777bc3d74:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 3769202da..ea107c2b5 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -81,11 +81,15 @@ class TraceController < ApplicationController conditions[0] += " AND gpx_files.visible = ?" conditions << true - @trace_pages, @traces = paginate(:traces, - :include => [:user, :tags], - :conditions => conditions, - :order => "gpx_files.timestamp DESC", - :per_page => 20) + @page = (params[:page] || 1).to_i + @page_size = 20 + + @traces = Trace.find(:all, + :include => [:user, :tags], + :conditions => conditions, + :order => "gpx_files.timestamp DESC", + :offset => (@page - 1) * @page_size, + :limit => @page_size) # put together SET of tags across traces, for related links tagset = Hash.new