rails3-jquery-autocomplete 1.0.8 → 1.0.9
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.
@@ -38,11 +38,13 @@ module SimpleForm
|
|
38
38
|
include Autocomplete
|
39
39
|
|
40
40
|
def input
|
41
|
+
# http://www.codeofficer.com/blog/entry/form_builders_in_rails_discovering_field_names_and_ids_for_javascript/
|
42
|
+
hidden_id = "#{object_name}_#{attribute_name}_hidden".gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
|
41
43
|
id_element = options[:id_element]
|
42
44
|
if id_element
|
43
|
-
id_element << ",
|
45
|
+
id_element << ", #" << hidden_id
|
44
46
|
else
|
45
|
-
id_element = "
|
47
|
+
id_element = "#" + hidden_id
|
46
48
|
end
|
47
49
|
options[:id_element] = id_element
|
48
50
|
autocomplete_options = rewrite_autocomplete_option
|
@@ -64,6 +66,7 @@ module SimpleForm
|
|
64
66
|
else
|
65
67
|
input_html_options
|
66
68
|
end
|
69
|
+
hidden_options[:id] = hidden_id
|
67
70
|
out << @builder.hidden_field(
|
68
71
|
attribute_name,
|
69
72
|
hidden_options
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails3-jquery-autocomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -270,12 +270,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
270
|
- - ! '>='
|
271
271
|
- !ruby/object:Gem::Version
|
272
272
|
version: '0'
|
273
|
+
segments:
|
274
|
+
- 0
|
275
|
+
hash: 1664383825138786605
|
273
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
274
277
|
none: false
|
275
278
|
requirements:
|
276
279
|
- - ! '>='
|
277
280
|
- !ruby/object:Gem::Version
|
278
281
|
version: '0'
|
282
|
+
segments:
|
283
|
+
- 0
|
284
|
+
hash: 1664383825138786605
|
279
285
|
requirements: []
|
280
286
|
rubyforge_project:
|
281
287
|
rubygems_version: 1.8.23
|