openstreetmap-website/app/controllers/old_way_controller.rb
Tom Hughes dcad29dad0 Split the rest action into sparate read, update and delete actions thus
allowing authorization to be done on a per-action basis without worring
about the method. This should make the user API work.

Also do a lot of cleanup of the controllers.
2007-06-27 17:27:10 +00:00

21 lines
506 B
Ruby

class OldWayController < ApplicationController
require 'xml/libxml'
def history
begin
way = Way.find(params[:id])
doc = OSM::API.new.get_xml_doc
way.old_ways.each do |old_way|
doc.root << old_way.to_xml_node
end
render :text => doc.to_s, :content_type => "text/xml"
rescue ActiveRecord::RecordNotFound
render :nothing => true, :status => :not_found
rescue
render :nothing => true, :status => :internal_server_error
end
end
end