X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c11d961f624cb610c4b8184d24e522b2c093d1ea..9d6ae5baae9f86acb8e2d9fcb006d8b81167281b:/app/controllers/way_controller.rb diff --git a/app/controllers/way_controller.rb b/app/controllers/way_controller.rb index 34f1ab5e7..dca9241a6 100644 --- a/app/controllers/way_controller.rb +++ b/app/controllers/way_controller.rb @@ -87,6 +87,7 @@ class WayController < ApplicationController when :delete if way.visible + way.user_id = @user.id way.visible = false way.save_with_history render :nothing => true @@ -135,4 +136,19 @@ class WayController < ApplicationController end end + def ways_for_segment + response.headers["Content-Type"] = 'text/xml' + wayids = WaySegment.find(:all, :conditions => ['segment_id = ?', params[:id]]).collect { |ws| ws.id }.uniq + if wayids.length > 0 + waylist = Way.find(wayids) + doc = OSM::API.new.get_xml_doc + waylist.each do |way| + doc.root << way.to_xml_node + end + render :text => doc.to_s + else + render :nothing => true, :status => 400 + end + end + end