-class WayController < ApplicationController\r
+class WayController < ApplicationController
require 'xml/libxml'
before_filter :authorize
after_filter :compress_output
- \r
+
def create
+ response.headers["Content-Type"] = 'text/xml'
if request.put?
way = Way.from_xml(request.raw_post, true)
render :nothing => true, :status => 500 # something went very wrong
end
- def full\r
+ def full
unless Way.exists?(params[:id])
render :nothing => true, :status => 404
return
end
def rest
+ response.headers["Content-Type"] = 'text/xml'
unless Way.exists?(params[:id])
render :nothing => true, :status => 404
return
end
way = Way.find(params[:id])
+
case request.method
when :get
doc = OSM::API.new.get_xml_doc
waylist.each do |way|
doc.root << way.to_xml_node
- end
+ end
render :text => doc.to_s
else
render :nothing => true, :status => 400