You need a browser that supports api geolocation to get the user's location (however you need user consent (example here ) for this (most new browsers support this feature, including IE9 + and most mobile OS browsers, including Windows Phone 7.5 +).
all you have to do is use javascript to get the location:
if (window.navigator.geolocation) {
var failure, success;
success = function(position) {
console.log(position);
};
failure = function(message) {
alert('Cannot retrieve location!');
};
navigator.geolocation.getCurrentPosition(success, failure, {
maximumAge: Infinity,
timeout: 5000
});
}
position ( , GPS-). : , , 300 - 30 GPS .
API Google (. ) . , Rails. , , , .
/, , Geonames , .