simple_autocomplete 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -3
- data/VERSION +1 -1
- data/example_js/javascripts/application.js +2 -2
- data/lib/simple_autocomplete.rb +2 -2
- data/simple_autocomplete.gemspec +1 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -44,7 +44,7 @@ The items passed into the block is an ActiveRecord scope allowing further scopes
|
|
44
44
|
|
45
45
|
View
|
46
46
|
----
|
47
|
-
<%= f.text_field :auto_user_name, :class => 'autocomplete', '
|
47
|
+
<%= f.text_field :auto_user_name, :class => 'autocomplete', 'data-autocomplete-url'=>autocomplete_for_user_name_users_path %>
|
48
48
|
|
49
49
|
Routes
|
50
50
|
------
|
@@ -60,7 +60,7 @@ use any library you like
|
|
60
60
|
//autocomplete
|
61
61
|
$('input.autocomplete').each(function(){
|
62
62
|
var $input = $(this);
|
63
|
-
$input.autocomplete($input.attr('
|
63
|
+
$input.autocomplete($input.attr('data-autocomplete-url'));
|
64
64
|
});
|
65
65
|
});
|
66
66
|
|
@@ -93,7 +93,8 @@ Inspired by DHH`s 'obstrusive' autocomplete_plugin.
|
|
93
93
|
###Contributors (alphabetical)
|
94
94
|
- [Bryan Ash](http://bryan-ash.blogspot.com/)
|
95
95
|
- [David Leal](http://github.com/david)
|
96
|
+
- [Splendeo](http://www.splendeo.es)
|
96
97
|
|
97
98
|
[Michael Grosser](http://pragmatig.wordpress.com)
|
98
99
|
grosser.michael@gmail.com
|
99
|
-
Hereby placed under public domain, do what you want, just do not hold me accountable...
|
100
|
+
Hereby placed under public domain, do what you want, just do not hold me accountable...
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
@@ -2,11 +2,11 @@ jQuery(function($){//on document ready
|
|
2
2
|
//autocomplete
|
3
3
|
$('input.autocomplete').each(function(){
|
4
4
|
var input = $(this);
|
5
|
-
input.autocomplete(input.attr('
|
5
|
+
input.autocomplete(input.attr('data-autocomplete-url'),{
|
6
6
|
matchContains:1,//also match inside of strings when caching
|
7
7
|
// mustMatch:1,//allow only values from the list
|
8
8
|
// selectFirst:1,//select the first item on tab/enter
|
9
9
|
removeInitialValue:0//when first applying $.autocomplete
|
10
10
|
});
|
11
11
|
});
|
12
|
-
});
|
12
|
+
});
|
data/lib/simple_autocomplete.rb
CHANGED
@@ -10,7 +10,7 @@ end
|
|
10
10
|
# end
|
11
11
|
#
|
12
12
|
# # View
|
13
|
-
# <%= text_field :post, title, :class => 'autocomplete', '
|
13
|
+
# <%= text_field :post, title, :class => 'autocomplete', 'data-autocomplete-url'=>autocomplete_for_post_title_posts_path %>
|
14
14
|
#
|
15
15
|
# #routes.rb
|
16
16
|
# map.resources :users, :collection => { :autocomplete_for_user_name => :get}
|
@@ -86,4 +86,4 @@ class ActiveRecord::Base
|
|
86
86
|
self.first(:conditions => [ "LOWER(#{attr}) = ?", value.to_s.downcase ])
|
87
87
|
end
|
88
88
|
end
|
89
|
-
end
|
89
|
+
end
|
data/simple_autocomplete.gemspec
CHANGED