auto_complete_jquery icon indicating copy to clipboard operation
auto_complete_jquery copied to clipboard

Cumbersome javascript

Open ari opened this issue 15 years ago • 0 comments

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 %>

ari avatar May 04 '09 02:05 ari