mercredi 16 mars 2016

How to find current location in ruby

I need to detect city automatically from where the user browses the site. i done by using geocoder gem.by reffering this stackoverflow answer "Rails 4 - How would I automatically detect a user's location and display it on the web app?"

Done the same steps like this, Added geocoder gem in gemfile, done bundle install and written this view code in my home page <%= request.location.city %>

i got blank output (without error), i run this code in live server

Can anyone tell me what is my mistake. Any help is appreciatable.

Aucun commentaire:

Enregistrer un commentaire