]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
When asked for ways which use a node, or relations which use some given
[rails.git] / app / controllers / way_controller.rb
index acba12def6a7f9f625b8fb78c2745d3eedc06143..413c65d1cd55f9f812670a09d302bc9c0a61e59f 100644 (file)
@@ -140,16 +140,12 @@ class WayController < ApplicationController
   def ways_for_node
     wayids = WayNode.find(:all, :conditions => ['node_id = ?', params[:id]]).collect { |ws| ws.id }.uniq
 
   def ways_for_node
     wayids = WayNode.find(:all, :conditions => ['node_id = ?', params[:id]]).collect { |ws| ws.id }.uniq
 
-    if wayids.length > 0
-      doc = OSM::API.new.get_xml_doc
-
-      Way.find(wayids).each do |way|
-        doc.root << way.to_xml_node
-      end
+    doc = OSM::API.new.get_xml_doc
 
 
-      render :text => doc.to_s, :content_type => "text/xml"
-    else
-      render :nothing => true, :status => :bad_request
+    Way.find(wayids).each do |way|
+      doc.root << way.to_xml_node
     end
     end
+
+    render :text => doc.to_s, :content_type => "text/xml"
   end
 end
   end
 end