You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should use the gem Geocoder, more exactly this feature :
In Any Rack-Based Framework
Detect Location of HTTP Request
Get current user's city and country (using IP address). A location method is added to the standard Rack::Request which returns a Geocoder::Result object:
# Rails controller or Sinatra app
city = request.location.city
country = request.location.country_code
Then when arriving on the homepage, we should directly scope elections of the country, so we have to call for example "/country-france" base on the field country_name of geocoder.
The text was updated successfully, but these errors were encountered:
We should use the gem Geocoder, more exactly this feature :
Then when arriving on the homepage, we should directly scope elections of the country, so we have to call for example "/country-france" base on the field country_name of geocoder.
The text was updated successfully, but these errors were encountered: