A mind that is stretched by a new experience can never go back to its old dimensions.

auto_complete with Rails 2.2

January 17th, 2009 Posted in geek out, popular

This page is about the auto_complete plugin for scriptaculous & Ruby on Rails 2.2. After looking through tons of pages and following countless dead links, here are the problems I had and how to fix them.

Error:

undefined method `text_field_with_auto_complete' for #<ActionView::Base:0x478d5e4>

Answer:

Install the auto_complete plugin.

command:ruby script/plugin install git://github.com/rails/auto_complete.git

Error:

ruby script/plugin install git://github.com/rails/auto_complete.git
removing: C:/Dropbox/My Dropbox/Ruby/mc/vendor/plugins/auto_complete/.git

Answer:

You don't have GIT installed. Its like a package manager. Get it from:http://git-scm.com/download

Error:

ruby script/plugin remove auto_complete
Plugin doesn't exist: C:/Dropbox/My Dropbox/Ruby/mcvendor/plugins/auto_complete

Answer:

Duh, it isn't installed. Install as directed above.

Error:

Just doesn't seem to work.

Answer:

Restart rails
Do the error logs tell you something?
Go over this article with a fine toothed comb:http://www.slash7.com/articles/2005/08/13/ajaxariffic-autocomplete-with-scriptaculous

Error:

ActionController::InvalidAuthenticityToken in your development.log

Answer:

There is a cross-site scripting protection that must be turned off. 
Add this to your controller:
skip_before_filter :verify_authenticity_token


  1. 1 Trackback(s)

  2. Jan 19, 2009: Cross Site Scripting » Blog Archive » Enerjee ยป Auto_complete with Rails 2.2

Post a Comment

CommentLuv badge