]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/search_controller.rb
Merge branch 'p' of https://github.com/jfirebaugh/openstreetmap-website into jfirebaugh-p
[rails.git] / app / controllers / search_controller.rb
index 0217bb29e021cef6ec3ab6e79fa3a8add4f48748..0d40b6691ab4e69e6fac431004d61a9327522e64 100644 (file)
@@ -2,8 +2,7 @@ class SearchController < ApplicationController
   # Support searching for nodes, ways, or all
   # Can search by tag k, v, or both (type->k,value->v)
   # Can search by name (k=name,v=....)
   # Support searching for nodes, ways, or all
   # Can search by tag k, v, or both (type->k,value->v)
   # Can search by name (k=name,v=....)
-  skip_before_filter :verify_authenticity_token
-  after_filter :compress_output
+  skip_before_action :verify_authenticity_token
 
   def search_all
     do_search(true, true, true)
 
   def search_all
     do_search(true, true, true)
@@ -34,13 +33,13 @@ class SearchController < ApplicationController
 
     if do_nodes
       response.headers["Error"] = "Searching of nodes is currently unavailable"
 
     if do_nodes
       response.headers["Error"] = "Searching of nodes is currently unavailable"
-      render :text => "", :status => :service_unavailable
+      head :service_unavailable
       return false
     end
 
     unless value
       response.headers["Error"] = "Searching for a key without value is currently unavailable"
       return false
     end
 
     unless value
       response.headers["Error"] = "Searching for a key without value is currently unavailable"
-      render :text => "", :status => :service_unavailable
+      head :service_unavailable
       return false
     end
 
       return false
     end
 
@@ -92,9 +91,9 @@ class SearchController < ApplicationController
     end
 
     relations.each do |rel|
     end
 
     relations.each do |rel|
-      doc.root << rel.to_xml_node(nil, changeset_cache, user_display_name_cache)
+      doc.root << rel.to_xml_node(changeset_cache, user_display_name_cache)
     end
 
     end
 
-    render :text => doc.to_s, :content_type => "text/xml"
+    render :xml => doc.to_s
   end
 end
   end
 end