]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Use bootstrap badges to implement count-number badges
[rails.git] / app / controllers / geocoder_controller.rb
index b779d353e98c69d29dbf4c5b6dc412c628ddff84..912247c9c15d622a88af5ac96a40886d045a3ac0 100644 (file)
@@ -88,18 +88,15 @@ class GeocoderController < ApplicationController
     response = fetch_xml("#{Settings.nominatim_url}search?format=xml&extratags=1&q=#{escape_query(query)}#{viewbox}#{exclude}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}")
 
     # extract the results from the response
-    results =  response.elements["searchresults"]
-
-    # extract parameters from more_url
-    more_url_params = CGI.parse(URI.parse(results.attributes["more_url"]).query)
+    results = response.elements["searchresults"]
 
     # create result array
     @results = []
 
     # create parameter hash for "more results" link
     @more_params = params
-                   .permit(:query, :minlon, :minlat, :maxlon, :maxlat, :exclude, :xhr)
-                   .merge(:exclude => more_url_params["exclude_place_ids"].first)
+                   .permit(:query, :minlon, :minlat, :maxlon, :maxlat, :exclude)
+                   .merge(:exclude => results.attributes["exclude_place_ids"])
 
     # parse the response
     results.elements.each("place") do |place|