]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/search_controller.rb
Use Faraday in place of Net::HTTP so we can mock responses
[rails.git] / app / controllers / search_controller.rb
index 7cd6f4ca7413704b3cff9f00b9d622f8b2e72691..8a632e6a2c2cebd9526afec79371a91cddc6e0fb 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=....)
-  skip_before_filter :verify_authenticity_token
-  after_filter :compress_output
+  skip_before_action :verify_authenticity_token
 
   def search_all
     do_search(true, true, true)
@@ -22,24 +21,24 @@ class SearchController < ApplicationController
   end
 
   def do_search(do_ways, do_nodes, do_relations)
-    type = params['type']
-    value = params['value']
+    type = params["type"]
+    value = params["value"]
     unless type || value
-      name = params['name']
+      name = params["name"]
       if name
-        type = 'name'
+        type = "name"
         value = name
       end
     end
 
     if do_nodes
-      response.headers['Error'] = "Searching of nodes is currently unavailable"
+      response.headers["Error"] = "Searching of nodes is currently unavailable"
       render :text => "", :status => :service_unavailable
       return false
     end
 
     unless value
-      response.headers['Error'] = "Searching for a key without value is currently unavailable"
+      response.headers["Error"] = "Searching for a key without value is currently unavailable"
       render :text => "", :status => :service_unavailable
       return false
     end