auto_complete_jquery
auto_complete_jquery copied to clipboard
Cumbersome javascript
I'd love to use this gem, but the problem is that the javascript which is recommended to be added to application.js or similar is very cumbersome.
$(document).ready(function() { $("input#post_title").autocomplete("auto_complete_for_post_title") });
This is very fragile since it relates to the specific choices made elsewhere ('post' and 'title' being changed later to 'post' and 'shortName' or something else). It also messes up one javascript file with 27 autocompletes used on 27 different pages on the site.
Is there some way for this gem to autogenerate the appropriate javascript and insert it onto each page? <%= autocomplete_js %>