Auto Complete plugin

Plugin details

Ajax auto completion for text fields. This plugin is intended for use with Rails 1.2 an greater.

Repositoryhttp://svn.rubyonrails.org/rails/plugins/auto_complete/ Author David Heinemeier Hansson Tags AJAX LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.rubyonrails.org/rails/plugins/auto_complete/

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'

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, 6 months ago