]> git.openstreetmap.org Git - rails.git/blob - app/controllers/old_segment_controller.rb
TomH's way history patch
[rails.git] / app / controllers / old_segment_controller.rb
1 class OldSegmentController < ApplicationController
2
3   def history
4     response.headers["Content-Type"] = 'text/xml'
5     segment = Segment.find(params[:id])
6
7     unless segment
8       render :nothing => true, :staus => 404
9       return
10     end
11
12     doc = OSM::API.new.get_xml_doc
13
14     segment.old_segments.each do |old_segment|
15       doc.root << old_segment.to_xml_node
16     end
17
18     render :text => doc.to_s
19   end
20 end