Questions tagged [rails-geocoder]

Geocoder is a complete geocoding solution for Ruby. With Rails it adds geocoding (by street or IP address), reverse geocoding (find street address based on given coordinates), and distance queries. It’s as simple as calling geocode on your objects, and then using a scope like Venue.near("Billings, MT").

Homepage

Source

397 questions
0
votes
0 answers

Input nearby rails model info from geocoder into gmaps4rails

I'm using the newer gmaps4rails and I can't seem to figure out how to make my nearby stores be located in gmaps4rails. In the show page I have my nearby stores code. I placed information on the .js code where I believe the rails code should be but…
0
votes
1 answer

Geocoder - how to fetch the country/region name?

I am trying to obtain the city, country and region name with using the Geocoder gem. This is how I am doing it: geo_data = Geocoder.search('50.131.44.XXX') puts geo_data.inspect puts geo_data[0].city #puts geo_data[0].inspect puts…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
1 answer

Ordering posts by distance to city using geocoder

I am trying to order my posts by how close they are to the location of the current user using geocoder. Here is the controller: def top @city = request.location.city @closepost = Post.near(@city, order: :distance) end and here is the view: <%…
user2759575
  • 553
  • 3
  • 25
0
votes
1 answer

Outsource geocoder location when writing a location based status

I am currently able to write a status in my app that saves the fetched user location (html5 javascript -> geocoder) right into the status database, when writing a new status. Now I want to outsource the location into a new model and relate to it in…
user3079933
  • 63
  • 1
  • 9
0
votes
1 answer

How to get city name and Remote IP address from Geocoder gem?

Rails 4 + Ruby 2 + Geocoder gem Controller Action def index @your_id = request.ip #here i am getting localhost IP address like "127.0.0.1" binding.pry end I think in @your_id , it should capture IP address not localhost IP…
Rajesh Gurbani
  • 211
  • 1
  • 6
  • 18
0
votes
2 answers

Rails 3, saving data without a form

How do I save information from my site http://yocoro.com/public into my database ? just by going to the page PS: I'm using 2 gems geocoder and user-agent to optain this information. //controller class PublicController < ApplicationController …
0
votes
2 answers

Ruby Geocoder is throwing error

I am working on RoR and using Ruby Geocoder for IP identification. The code snippet I use giving below. Gemfile gem "geocoder" Then for fetching country I am using country = request.location.country It was working perfectly before,but now it is…
apr
  • 676
  • 1
  • 9
  • 21
0
votes
0 answers

rails2 ruby geocoder issue when finding the distance

I'm using ruby geocoder gem in my rails2 app. When a user tries to sign up i'm taking his ip and fetching lat and long using geocoder. Next, taking user entered address and fetching lat and longitude. Finally checking the distance between those…
0
votes
1 answer

Devise guest user - updating an attribute

I'm using Devise in my Rails 3 app, and I've implemented some guest user funcitonality as outlined here. The issue I'm having here is that my app relies on somewhat accurate geocoding (using rails geocoder and geocoding Users by zip) and so I don't…
settheline
  • 3,333
  • 8
  • 33
  • 65
0
votes
1 answer

GEOCODER: Fetching User Geolocation to generate status updates with location attributes in rails 3

I am totally new to RoR (currently using Ruby 1.9.3 and Rails 3.2.16). I have read lots of tutorials and ebooks on how to use rails in the last few days. Now I want to create some kind of blog for multiple users ( a traveling journal for me and my…
user3079933
  • 63
  • 1
  • 9
0
votes
1 answer

Rails 4 use of non-model attributes in params resulting in undefined method `merge' for nil:NilClass

I have a search form on an index page for my Properties model which is using both Ransack and Geocoder to search the Properties model fields as well as narrow the results down based on distance from an address input by the user in the search form. …
0
votes
1 answer

Is there a way to get the visitors city and country in Rails controller?

In my current app, i use Geocoder gem to get the city and the country of the visitor. I use hidden fields in my view to get these details. When the login form is submitted, these details will be sent to the controller and the controller will save…
THpubs
  • 7,804
  • 16
  • 68
  • 143
0
votes
1 answer

Rails Geocoder MapIt functionality alternatives

I'm working with rails, geocoder and gmap4rails. Trying to figure out how to show boundaries of an ward district area in UK. Found mapit - Mapit by mySociaty . Would be amazing if anyone could suggest or point me in the direction for creating a…
0
votes
1 answer

Rails geocoder - geocoding for registered and guest users

I've got an app that uses rails geocoder to find locations of registered users by their provided zip code. This works well for registered users, but I also want to extend some functionality to guest users. I'm using devise's solution for guest users…
settheline
  • 3,333
  • 8
  • 33
  • 65
0
votes
1 answer

How to setup Geocoder to use database for lat/long

I have the Geocoder gem installed and I want to disable the use of an API. I have 47,000 latitude/longitude coordinates inside the zipcode table. I want to use the data I have inside my database, and not Google's API. How would I do this so that it…
xps15z
  • 1,769
  • 1
  • 20
  • 38