autocomplete_address_safe 0.1.2 → 0.1.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3405e6728b2814c118ccbd7a848261c71750d46f
|
4
|
+
data.tar.gz: 7f2cfc6ef8a9a1b3e8fab3a5f054c36c9fee0aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17fbbc3ac88f58fb13426ca66cefd182fca019c558f26ff3ee2e9a74002b6208f01886b68a1d470513a379390b7e6d411b527da297f995ec7745f9bec8e685d
|
7
|
+
data.tar.gz: 147b0d1635a269c0cef0a4f4a35896fa083c3a6885c3665c8b761cf0581aa13b3e1513fcd142904f1a0ead401243ed9ec248295eb725c493b8d1aa5eaca9e8aa
|
@@ -1,7 +1,34 @@
|
|
1
1
|
module AutocompleteAddressSafe
|
2
2
|
|
3
|
-
def field_complete()
|
4
|
-
|
3
|
+
def field_complete(*args)
|
4
|
+
#if args.nil?
|
5
|
+
# text_field 'autocomplete', nil, id:'autocomplete',placeholder:'Ingrese su ubicación', onfocus:'geolocate()', autocomplete: 'off'
|
6
|
+
#else
|
7
|
+
# text_field
|
8
|
+
#end
|
9
|
+
if args.empty?
|
10
|
+
text_field_tag 'autocomplete', nil, id:'autocomplete',placeholder:'Ingrese su ubicación', onfocus:'geolocate()', autocomplete: 'off'
|
11
|
+
else
|
12
|
+
options = add_default_data(args.extract_options!)
|
13
|
+
args << options
|
14
|
+
text_field_tag('autocomplete', '', *args)
|
15
|
+
end
|
5
16
|
end
|
6
17
|
|
18
|
+
def add_default_data(options)
|
19
|
+
id_name = "autocomplete"
|
20
|
+
unless options.key?(:id)
|
21
|
+
options[:id] = id_name
|
22
|
+
end
|
23
|
+
unless options.key?(:onfocus)
|
24
|
+
options[:onfocus] = 'geolocate()'
|
25
|
+
end
|
26
|
+
unless options.key?(:autocomplete)
|
27
|
+
options[:autocomplete] = 'off'
|
28
|
+
end
|
29
|
+
options
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
|
7
34
|
end
|
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.3
|
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-07-
|
11
|
+
date: 2015-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|