Yogendra
Yogendra

Reputation: 1

Rails Geocoder object does not contain postcode

Using rails Geocoder gem.Trying to search with postcode but it's returning nil while the postcode is valid. Geocoder.search(454774) => nil

sample postcode : 454774

Note : nil value is coming because the postcode is missing in search object.

Any solution?

Upvotes: 0

Views: 59

Answers (1)

Willard Moore
Willard Moore

Reputation: 11

I don't think it likes that you're giving it an integer. Looking at the github I am expecting that they want you to give them a string instead. I'm not personally familiar with a zip code of this length. As long as it's a valid zip code I would expect it to return something. Does this work?

Geocoder.search("454774")

Upvotes: 1

Related Questions