1

I'm very new to Rails. My company is switching projects from Rails 3 to Rails 4, so I'd like to understand the packaging of automatic completion in both.

From my understanding there was originally a Rails plugin, auto_complete, which I'm guessing used Prototype. As of version 3, Rails is agnostic of JavaScript frameworks so the automatic completion functionality was moved to gems. The jQuery version of this gem, rails3-jquery-autocomplete, makes use of the jQuery UI widget, Autocomplete.

Now, in attempting to figure all of this out I removed 'jquery-rails' from the Gemfile of a Rails 4 project, but I can somehow still successfully require both 'jquery' and 'jquery.ui.autocomplete' in my application manifest. Since obviously jQuery is included in Rails now, do I still need a gem to make Rails 4 work with jQuery's Autocomplete? Something like, rails4-jquery-autocomplete? I would think so, but what's really confusing me is that I don't get a method undefined error when I use 'text_field_with_auto_complete'. Instead, I get an unmatched route error.

lwiseman
  • 750
  • 7
  • 29
  • 1
    Personally, I like keeping javascript and rails completely separate. I find that integrating rails and jquery is a bit troublesome because I run into library version issues. I'm probably not going to go with turbo links :) – Daniel Jul 22 '13 at 01:33
  • That's how I've done it so far, Daniel, using something like [this](http://stackoverflow.com/a/3222639/354311). I'd just love to abstract that away with a text_field_with_auto_complete if I can figure out how with Rails 3 and 4. – lwiseman Jul 22 '13 at 02:41

0 Answers0