X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/300c3b4ed40d80a483ea9e52b1591e2c38ef7209..f09b16cade5447158606e37ebd6c9cd86fc8b50b:/app/controllers/way_controller.rb?ds=sidebyside diff --git a/app/controllers/way_controller.rb b/app/controllers/way_controller.rb index acba12def..413c65d1c 100644 --- a/app/controllers/way_controller.rb +++ b/app/controllers/way_controller.rb @@ -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 - 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 + + render :text => doc.to_s, :content_type => "text/xml" end end