I am using geocoder to get latitude and longitude from address
In model I added
class Clinic < ApplicationRecord
geocoded_by :full_street_address
after_validation :geocode
def full_street_address
[address_line1, city, state, country].compact.join(', ')
end
end
and client has provided me addresses like this
{
"name": "Bahrain Defence Force Royal Medical Services Hospital - Riffa",
"address_line1": "West Riffa P O Box 28743",
"country": "Bahrain",
"state": "Al-Wusta",
"city": "Riffa"
}
Now when I create a clinic its not returning latitude and longitude,
Seems that issue is with address and than with following line
[address_line1, city, state, country].compact.join(', ')
Is there a way I can specifically provide zipcode etc or how to handle above address?