Skip to content
This repository was archived by the owner on Feb 20, 2018. It is now read-only.

add address maps in readme #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,38 @@ Multiple options:
end
```

### Google Map Address

A simple way to find latitude and longitude values trhough a google map. Basic usage:

Requires the following in config/initializers/active_admin.rb

```ruby
ActiveAdmin.application.register_javascript "https://maps.googleapis.com/maps/api/js?sensor=false"
```

Add address (or any other name), latitude end longitude string column to your model via migration

```ruby
def change
add_column :apartments, :address, :string
add_column :apartments, :latitude, :string
add_column :apartments, :longitude, :string
end
```

Configure your active admin model file

```ruby
/app/admin/apartement.rb

form do |f|
f.inputs :logistic do
f.input :address, as: :map_address
end
end
```

## Copyright

Copyright (c) 2012 Stefano Verna, Cantiere Creativo
Expand Down