def do_search(do_ways,do_segments,do_nodes)
- response.headers["Content-Type"] = 'text/xml'
-
type = params['type']
value = params['value']
unless type or value
# Fetch any segments needed for our ways (only have matching segments so far)
seg_ids = Array.new
ways.each do |way|
- seg_ids += way.segments
+ seg_ids += way.segs
end
segments += Segment.find(seg_ids)
# Fetch any nodes needed for our segments (only have matching nodes so far)
node_ids = Array.new
segments.each do |seg|
- node_ids += seg.node_a
- node_ids += seg.node_b
+ node_ids += [seg.node_a, seg.node_b]
end
nodes += Node.find(node_ids)
doc.root << way.to_xml_node()
end
- render :text => doc.to_s
+ render :text => doc.to_s, :content_type => "text/xml"
end
end