]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
innitial by tag / by user code
[rails.git] / app / controllers / trace_controller.rb
index 3f689fd3ae7ef33a9f9970513b4cc2b18d9d53db..fa062b7289534d618f281c71afe39e37f308847f 100644 (file)
@@ -4,11 +4,21 @@ class TraceController < ApplicationController
 
   def list
     @page = params[:page].to_i
 
   def list
     @page = params[:page].to_i
+
+    opt = Hash.new
+    opt[:conditions] = ['public = true']
+    opt[:order] = 'timestamp DESC'
+    opt[:limit] = 20
+
     if @page > 0
     if @page > 0
-      @traces = Trace.find(:all , :conditions => ['public = true'], :order => 'timestamp DESC', :offset => 20*@page, :limit => 20)
-    else
-      @traces = Trace.find(:all , :conditions => ['public = true'], :order => 'timestamp DESC', :limit => 20)
+      opt[:offset => 20*@page]
     end
     end
+
+    if params[:tag]
+      
+    end
+
+    @traces = Trace.find(:all , opt)
   end
 
   def view
   end
 
   def view