- begin
- way = Way.find(params[:id])
- new_way = Way.from_xml(request.raw_post)
- if new_way and new_way.id == way.id
- way.delete_with_history(@user)
-
- # if we get here, all is fine, otherwise something will catch below.
- render :nothing => true
- else
- render :nothing => true, :status => :bad_request
- end
- rescue OSM::APIError => ex
- render ex.render_opts
- rescue ActiveRecord::RecordNotFound
- render :nothing => true, :status => :not_found
+ way = Way.find(params[:id])
+ new_way = Way.from_xml(request.raw_post)
+
+ if new_way and new_way.id == way.id
+ way.delete_with_history!(new_way, @user)
+ render :text => way.version.to_s, :content_type => "text/plain"
+ else
+ render :text => "", :status => :bad_request