X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a6f61bd18aebe24d7488447b18d49158b15a71fa..d85887e14698d4c4f03da78dcb78169ad12de297:/app/controllers/old_segment_controller.rb?ds=sidebyside diff --git a/app/controllers/old_segment_controller.rb b/app/controllers/old_segment_controller.rb index e07026fa4..1f64987ed 100644 --- a/app/controllers/old_segment_controller.rb +++ b/app/controllers/old_segment_controller.rb @@ -1,2 +1,20 @@ class OldSegmentController < ApplicationController + + def history + response.headers["Content-Type"] = 'text/xml' + segment = Segment.find(params[:id]) + + unless segment + render :nothing => true, :staus => 404 + return + end + + doc = OSM::API.new.get_xml_doc + + segment.old_segments.each do |old_segment| + doc.root << old_segment.to_xml_node + end + + render :text => doc.to_s + end end