X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7c1b6e850d4a177776aaaabcd8b2343790024004..b95e9d27599ee55b2fd61a444acc3264c7637265:/app/controllers/way_controller.rb?ds=sidebyside diff --git a/app/controllers/way_controller.rb b/app/controllers/way_controller.rb index 2c948214e..49a3b3bfe 100644 --- a/app/controllers/way_controller.rb +++ b/app/controllers/way_controller.rb @@ -26,4 +26,33 @@ class WayController < ApplicationController render :nothing => true, :status => 500 # something went very wrong end + def rest + unless Way.exists?(params[:id]) + render :nothing => true, :status => 404 + return + end + + way = Way.find(params[:id]) + case request.method + + when :get + unless way.visible + render :nothing => true, :status => 410 + return + end + render :text => way.to_xml.to_s + + when :delete + unless way.visible + render :nothing => true, :status => 410 + return + end + + way.visible = false + way.save_with_history + + end + + end + end