more way bits

This commit is contained in:
Steve Coast 2006-08-26 21:36:21 +00:00
parent 7c1b6e850d
commit b95e9d2759
9 changed files with 97 additions and 4 deletions

View file

@ -28,7 +28,7 @@ class NodeController < ApplicationController
def rest
unless Node.exists?(params[:id])
render :nothing => true, :status => 400
render :nothing => true, :status => 404
return
end

View file

@ -36,7 +36,7 @@ class SegmentController < ApplicationController
def rest
unless Segment.exists?(params[:id])
render :nothing => true, :status => 400
render :nothing => true, :status => 404
return
end

View file

@ -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

View file

@ -0,0 +1,2 @@
class WaySegmentController < ApplicationController
end