README.markdown in rails3-jquery-autocomplete-0.9.1 vs README.markdown in rails3-jquery-autocomplete-1.0.0
- old
+ new
@@ -15,14 +15,10 @@
## MongoID
You can find a [detailed example](http://github.com/crowdint/rails3-jquery-autocomplete-app/tree/mongoid)
on how to use this gem with MongoID [here](http://github.com/crowdint/rails3-jquery-autocomplete-app/tree/mongoid). (Same thing, different branch)
-## MongoMapper
-
-TODO
-
## Before you start
Make sure your project is using jQuery-UI and the autocomplete widget
before you continue.
@@ -42,18 +38,28 @@
Install it
bundle install
+### Rails 3.0.x
+
Run the generator
rails generate autocomplete:install
And include autocomplete-rails.js on your layouts
javascript_include_tag "autocomplete-rails.js"
+### Rails 3.1.x
+
+Just add it to your app/assets/javascripts/application.js file
+
+ //= require jquery
+ //= require jquery_ujs
+ //= require autocomplete
+
## Upgrading from older versions
If you are upgrading from a previous version, run the generator after installing to replace the javascript file.
rails generate autocomplete:install
@@ -224,11 +230,11 @@
## Formtastic
If you are using [Formtastic](http://github.com/justinfrench/formtastic), you automatically get the *autocompleted_input* helper on *semantic_form_for*:
semantic_form_for @product do |f|
- f.autocompleted_input :brand_name, :url => autocomplete_brand_name_products_path
+ f.input :brand_name, :as => :autocomplete, :url => autocomplete_brand_name_products_path
end
The only difference with the original helper is that you must specify the autocomplete url using the *:url* option.
## SimpleForm
@@ -279,12 +285,12 @@
choose_autocomplete_result
An example on how to use it:
scenario "Autocomplete" do
- lambda do
+ lambda do
Brand.create! [
- {:name => "Alpha"},
+ {:name => "Alpha"},
{:name => "Beta"},
{:name => "Gamma"}
]
end.should change(Brand, :count).by(3)