autocomplete_address_safe 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +17 -1
- data/app/assets/javascript/autocomplete_address_options.js.erb +2 -0
- data/app/assets/javascript/autocomplete_address_safe.js +3 -0
- data/app/assets/javascript/barracuda.js +1 -3
- data/app/assets/javascript/googlemaps.js +3 -4
- data/lib/autocomplete_address_safe/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757e4c8a23c7e3255be5920b0044700a5dd14192
|
4
|
+
data.tar.gz: 1ef3907a002d7104a4f17fbf163fd3b14fd96e54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd23a8b3c3c6116932a0d95877049e36dcedda6b35965229147172937765e0256158563ad5e18c9f1637005f1aaca336fce0a4235efcdbd5c89d8333c73eb916
|
7
|
+
data.tar.gz: f43ae43ecc63b0de38c8f32d9a51e2371d794675af41b2b3f82b352a8898c7d1a7127b1b37dd54f44aee83272fa392035368134e0695033a3867ebd3f876a180
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,22 @@ TODO: Delete this and the text above, and describe your gem
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
+
First add the js google maps for example
|
10
|
+
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
|
11
|
+
|
12
|
+
Second add the js in the view
|
13
|
+
|
14
|
+
<script type="text/javascript">
|
15
|
+
var ready;
|
16
|
+
|
17
|
+
ready = function(){
|
18
|
+
$('body').attr('onload', 'initialize()');
|
19
|
+
}
|
20
|
+
|
21
|
+
$('document').ready(ready);
|
22
|
+
$('document').on('page:load', ready);
|
23
|
+
</script>
|
24
|
+
|
9
25
|
Add this line to your application's Gemfile:
|
10
26
|
|
11
27
|
```ruby
|
@@ -26,7 +42,7 @@ The first step add next code in "app/assets/javascripts/application.js"
|
|
26
42
|
|
27
43
|
//= require autocomplete_safe
|
28
44
|
|
29
|
-
The second step add in your view
|
45
|
+
The second step add in your view
|
30
46
|
<%= field_complete %>
|
31
47
|
|
32
48
|
And add other input id's (lat, long, locality, country, administrative_area_level_1, route, street_number, postal_code)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// This example displays an address form, using the autocomplete feature
|
2
2
|
// of the Google Places API to help users fill in the information.
|
3
|
-
document.write('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>');
|
3
|
+
//document.write('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places" ></script>');
|
4
|
+
|
4
5
|
|
5
6
|
var placeSearch, autocomplete;
|
6
7
|
var componentForm = {
|
@@ -32,9 +33,7 @@ function fillInAddress() {
|
|
32
33
|
document.getElementById(component).value = '';
|
33
34
|
document.getElementById(component).disabled = false;
|
34
35
|
}*/
|
35
|
-
|
36
|
-
console.log(place.geometry.location.lat());
|
37
|
-
console.log(place.geometry.location.lng());
|
36
|
+
|
38
37
|
//Get each component of the address from the place details
|
39
38
|
//and fill the corresponding field on the form.
|
40
39
|
for (var i = 0; i < place.address_components.length; i++) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autocomplete_address_safe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saul Felipe Ramirez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|