X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8c9544e60a6b4699a475623aed179bfb6bc96337..e799022131f3e833179e9058060ec5e136ed2edd:/app/controllers/node_controller.rb diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index 416d1794f..5370306f3 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -4,6 +4,7 @@ class NodeController < ApplicationController before_filter :authorize def create + response.headers["Content-Type"] = 'application/xml' if request.put? node = nil begin @@ -33,6 +34,7 @@ class NodeController < ApplicationController end def rest + response.headers["Content-Type"] = 'application/xml' unless Node.exists?(params[:id]) render :nothing => true, :status => 404 return @@ -85,32 +87,4 @@ class NodeController < ApplicationController end - def history - node = Node.find(params[:id]) - - unless node - render :nothing => true, :staus => 404 - return - end - - doc = XML::Document.new - doc.encoding = 'UTF-8' - root = XML::Node.new 'osm' - root['version'] = '0.4' - root['generator'] = 'OpenStreetMap server' - doc.root = root - - node.old_nodes.each do |old_node| - el1 = XML::Node.new 'node' - el1['id'] = old_node.id.to_s - el1['lat'] = old_node.latitude.to_s - el1['lon'] = old_node.longitude.to_s - Node.split_tags(el1, old_node.tags) - el1['visible'] = old_node.visible.to_s - el1['timestamp'] = old_node.timestamp.xmlschema - root << el1 - end - - render :text => doc.to_s - end end