Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

replaced autocomplete_url by data-autocomplete-url on code, examples …

…and readme
  • Loading branch information...
commit 3daf35590b060811512b7d14ac6d2503c28ee3fe 1 parent 58224e5
egarcia authored
View
6 README.markdown
@@ -44,7 +44,7 @@ The items passed into the block is an ActiveRecord scope allowing further scopes
View
----
- <%= f.text_field :auto_user_name, :class => 'autocomplete', 'autocomplete_url'=>autocomplete_for_user_name_users_path %>
+ <%= f.text_field :auto_user_name, :class => 'autocomplete', 'data-autocomplete-url'=>autocomplete_for_user_name_users_path %>
Routes
------
@@ -60,7 +60,7 @@ use any library you like
//autocomplete
$('input.autocomplete').each(function(){
var $input = $(this);
- $input.autocomplete($input.attr('autocomplete_url'));
+ $input.autocomplete($input.attr('data-autocomplete-url'));
});
});
@@ -96,4 +96,4 @@ Inspired by DHH`s 'obstrusive' autocomplete_plugin.
[Michael Grosser](http://pragmatig.wordpress.com)
grosser.michael@gmail.com
-Hereby placed under public domain, do what you want, just do not hold me accountable...
+Hereby placed under public domain, do what you want, just do not hold me accountable...
View
4 example_js/javascripts/application.js
@@ -2,11 +2,11 @@ jQuery(function($){//on document ready
//autocomplete
$('input.autocomplete').each(function(){
var input = $(this);
- input.autocomplete(input.attr('autocomplete_url'),{
+ input.autocomplete(input.attr('data-autocomplete-url'),{
matchContains:1,//also match inside of strings when caching
// mustMatch:1,//allow only values from the list
// selectFirst:1,//select the first item on tab/enter
removeInitialValue:0//when first applying $.autocomplete
});
});
-});
+});
View
4 lib/simple_autocomplete.rb
@@ -10,7 +10,7 @@ module SimpleAutocomplete
# end
#
# # View
-# <%= text_field :post, title, :class => 'autocomplete', 'autocomplete_url'=>autocomplete_for_post_title_posts_path %>
+# <%= text_field :post, title, :class => 'autocomplete', 'data-autocomplete-url'=>autocomplete_for_post_title_posts_path %>
#
# #routes.rb
# map.resources :users, :collection => { :autocomplete_for_user_name => :get}
@@ -86,4 +86,4 @@ def self.find_by_autocomplete(attr)
self.first(:conditions => [ "LOWER(#{attr}) = ?", value.to_s.downcase ])
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.