Plugins - auto_complete

StarAdd to favorites

Example:

# Controller
class BlogController < ApplicationController
auto_complete_for :post, :title
end

# View
<%= text_field_with_auto_complete :post, title %>

By default, auto_complete_for limits the results to 10 entries,
and sorts by the given field.

auto_complete_for takes a third parameter, an options hash to
the find method used to search for the records:

auto_complete_for :post, :title, :limit => 15, :order => 'created_at DESC'

For more examples, see script.aculo.us:
* http://script.aculo.us/demos/ajax/autocompleter
* http://script.aculo.us/demos/ajax/autocompleter_customized

Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license

git://github.com/rails/auto_complete.git

Rails' (MIT)

  • Currently 3.3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
Robb 16 Jul 2008

Great plugin -- thanks. It's small and focused.

Tomasz Mazur 29 Jan 2008

Hej. If you have problems to get it work take a look at mini tutorial ho wto use this plugin in Rails > 2.0

http://trix.pl/blog/ruby-on-rails/auto-complete-for-rails-2-0-tutorial

John 27 Dec 2007

The plugin does not work!!!

No error messages, no documentation available and nothing found in google, if get it working consider yourself lucky.

It used to work like a charm in rails 1.2... :'(

Archie 16 Dec 2007

David thanks for the plugin. I have not been able to make it work though. I've made sure everything is in the right place in the controller and views. I don't get any errors in fact I get nothing at all. I have also downloaded the latest .js files with no success. Would appreciate any advice. Thank you again.

JBB 4 Dec 2007

Great to have the leaders of RAILS, like David, committed to making transitions in the framework go smoothly. The effort to post this plugin well in advance of RAILS 2.0 - which will no longer natively have the auto complete functionality - is a great example of the quality of the RAILS community.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?