]> git.openstreetmap.org Git - rails.git/commitdiff
Merge the gpx_bugs action into the main get_bugs action
authorTom Hughes <tom@compton.nu>
Sat, 7 May 2011 16:21:38 +0000 (17:21 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 7 May 2011 16:30:53 +0000 (17:30 +0100)
app/controllers/map_bugs_controller.rb
config/routes.rb

index 2de11ba755e49578e5c58c9ff2591a6e8d63e3a7..158bf435aa0837356e7b0beab36f0d20638795b5 100644 (file)
@@ -127,7 +127,6 @@ class MapBugsController < ApplicationController
     render_ok
   end 
 
     render_ok
   end 
 
-
   def rss
     # Figure out the bbox
     bbox = params['bbox']
   def rss
     # Figure out the bbox
     bbox = params['bbox']
@@ -145,18 +144,13 @@ class MapBugsController < ApplicationController
     limit = getLimit
     conditions = closedCondition
     conditions = cond_merge conditions, [OSM.sql_for_area_no_quadtile(@min_lat, @min_lon, @max_lat, @max_lon)]
     limit = getLimit
     conditions = closedCondition
     conditions = cond_merge conditions, [OSM.sql_for_area_no_quadtile(@min_lat, @min_lon, @max_lat, @max_lon)]
-       
+       
     check_boundaries(@min_lon, @min_lat, @max_lon, @max_lat, :false)
 
     @comments = MapBugComment.find(:all, :limit => limit, :order => "date_created DESC", :joins => :map_bug, :include => :map_bug, :conditions => conditions)
     render :template => 'map_bugs/rss.rss'
   end
 
     check_boundaries(@min_lon, @min_lat, @max_lon, @max_lat, :false)
 
     @comments = MapBugComment.find(:all, :limit => limit, :order => "date_created DESC", :joins => :map_bug, :include => :map_bug, :conditions => conditions)
     render :template => 'map_bugs/rss.rss'
   end
 
-  def gpx_bugs
-    request.format = :xml
-    get_bugs
-  end
-  
   def read
     @bug = MapBug.find(params['id'])
     raise OSM::APINotFoundError unless @bug
   def read
     @bug = MapBug.find(params['id'])
     raise OSM::APINotFoundError unless @bug
index 62c43ee031cfe40e283dc10e3656a5cfa642e324..ddd2777d566df70f93ae019c94e144a3547c4370 100644 (file)
@@ -80,7 +80,7 @@ ActionController::Routing::Routes.draw do |map|
   map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller => 'map_bugs', :action => 'add_bug'
   map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller => 'map_bugs', :action => 'close_bug'
   map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller => 'map_bugs', :action => 'edit_bug'
   map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller => 'map_bugs', :action => 'add_bug'
   map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller => 'map_bugs', :action => 'close_bug'
   map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller => 'map_bugs', :action => 'edit_bug'
-  map.connect "api/#{API_VERSION}/bugs/getGPX", :controller => 'map_bugs', :action => 'gpx_bugs'
+  map.connect "api/#{API_VERSION}/bugs/getGPX", :controller => 'map_bugs', :action => 'get_bugs', :format => :gpx
   map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller => 'map_bugs', :action => 'rss'
   map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs'
   map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search'
   map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller => 'map_bugs', :action => 'rss'
   map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs'
   map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search'