-
Notifications
You must be signed in to change notification settings - Fork 382
Model Customization
The easiest way to declare gmaps4rails in your model is:
acts_as_gmappable
The following default config will be assumed:
-
:process_geocoding => true
: the geocode will be performed each time the model through a validate method -
:validation => true
: if the position of the address provided isn't found by google, an error will be displayed -
:lat_column => "gmaps4rails_latitude"
,:lng_column => "gmaps4rails_longitude"
: latitude and longitude will be saved in the tablesgmaps4rails_latitude
andgmaps4rails_longitude
-
:check_process => true
,:checker => "gmaps
: the status of the geocode, will be saved in a boolean calledgmaps
All or part of these default behaviours can be customized with the following arguments:
-
:lat_column
: string -
:lng_column
: string -
:process_geocoding
: true/false
These are only used if process_geocoding
is true:
-
:check_process
: true/false -
:checker
: string (only if check_process is true) -
:validation
: true/false -
:msg
: string, to customize the error message in validation (if activated)
You could do the following:
acts_as_gmappable :process_geocoding => false, :lat_column` => "latitude", :lng_column => "longitude"