RailsCasts Pro episodes are now free!

Learn more or hide this

rajkiran's Profile

GitHub User: rajkiran

Comments by


Hi.. I am working with geocoder.
In my model, i am having fields like location, city, state, country and Pin code/ Zip code..
With the help of Geocoder i could be able to locate the complete address including street, city, state and country.

But my requirement is i need to locate the place with the help of Zip code too...

Here is my model:

class Employee < ActiveRecord::Base
attr_accessible :name, :location, :city, :state, :country, :pincode, :latitude, :longitude
def address
[location, city, state, country].compact.join(', ')
geocoded_by :address
after_validation :geocode, :if => :location_changed?

Can anyone help me out????????????