From: Anton Khorev Date: Sun, 30 Mar 2025 03:04:31 +0000 (+0300) Subject: Move search fetch url construction to controller X-Git-Tag: live~68^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/1fe7335fc4958d85160cd8c76ac8eade1fb76c2b?ds=inline;hp=--cc Move search fetch url construction to controller --- 1fe7335fc4958d85160cd8c76ac8eade1fb76c2b diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index f23448bff..0ccd1d14b 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -13,10 +13,10 @@ class GeocoderController < ApplicationController @sources = [] if @params[:lat] && @params[:lon] - @sources.push(:name => "latlon", :url => root_path) - @sources.push(:name => "osm_nominatim_reverse", :url => nominatim_reverse_url(:format => "html")) + @sources.push(:name => "latlon", :url => root_path, :fetch_url => url_for(@params.merge(:action => "search_latlon"))) + @sources.push(:name => "osm_nominatim_reverse", :url => nominatim_reverse_url(:format => "html"), :fetch_url => url_for(@params.merge(:action => "search_osm_nominatim_reverse"))) elsif @params[:query] - @sources.push(:name => "osm_nominatim", :url => nominatim_url(:format => "html")) + @sources.push(:name => "osm_nominatim", :url => nominatim_url(:format => "html"), :fetch_url => url_for(@params.merge(:action => "search_osm_nominatim"))) end if @sources.empty? diff --git a/app/views/geocoder/search.html.erb b/app/views/geocoder/search.html.erb index 56f468f2f..efbaab253 100644 --- a/app/views/geocoder/search.html.erb +++ b/app/views/geocoder/search.html.erb @@ -6,7 +6,7 @@

<%= link_to t(".title.#{source[:name]}"), source[:url].to_s %>

-
"> +
<%= t("browse.start_rjs.loading") %>