1 class OldNodeController < ApplicationController
5 before_filter :check_api_readable
6 after_filter :compress_output
10 node = Node.find(params[:id])
12 doc = OSM::API.new.get_xml_doc
14 node.old_nodes.each do |old_node|
15 doc.root << old_node.to_xml_node
18 render :text => doc.to_s, :content_type => "text/xml"
19 rescue ActiveRecord::RecordNotFound
20 render :nothing => true, :status => :not_found
22 render :nothing => true, :status => :internal_server_error
28 old_node = OldNode.find(:first, :conditions => {:id => params[:id], :version => params[:version]} )
30 response.headers['Last-Modified'] = old_node.timestamp.rfc822
32 doc = OSM::API.new.get_xml_doc
33 doc.root << old_node.to_xml_node
35 render :text => doc.to_s, :content_type => "text/xml"
36 rescue ActiveRecord::RecordNotFound
37 render :nothing => true, :status => :not_found
39 render :nothing => true, :status => :internal_server_error