- def rest
- response.headers["Content-Type"] = 'text/xml'
- unless Way.exists?(params[:id])
- render :nothing => true, :status => 404
- return
+ # This is the API call to delete a way
+ def delete
+ begin
+ way = Way.find(params[:id])
+ way.delete_with_history(@user)
+
+ # if we get here, all is fine, otherwise something will catch below.
+ render :nothing => true
+ rescue OSM::APIError => ex
+ render ex.render_opts
+ rescue ActiveRecord::RecordNotFound
+ render :nothing => true, :status => :not_found