- node = Node.find(params[:id])
-
-
- case request.method
- when :get
- doc = XML::Document.new
-
- doc.encoding = "UTF-8"
- root = XML::Node.new 'osm'
- root['version'] = '0.4'
- root['generator'] = 'OpenStreetMap server'
- doc.root = root
- el1 = XML::Node.new 'node'
- el1['id'] = node.id.to_s
- el1['lat'] = node.latitude.to_s
- el1['lon'] = node.longitude.to_s
- split_tags(el1, node.tags)
- el1['visible'] = node.visible.to_s
- el1['timestamp'] = node.timestamp.xmlschema
- root << el1
-
- render :text => doc.to_s
+ # Update a node from given XML
+ def update
+ begin
+ node = Node.find(params[:id])
+ new_node = Node.from_xml(request.raw_post)