Auto Completion plugin
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits ahead of david-kerins:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.ruby-gemset
.ruby-version
Gemfile
LICENSE.txt
README.md
Rakefile
auto_complete.gemspec
init.rb

README.md

AutoComplete

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'auto_complete'

And then execute:

$ bundle

Or install it yourself as:

$ gem install auto_complete

Usage

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:

WARNING

The test suite doesn't work at the moment.