Tuesday, October 23, 2007

Autocomplete in Rails 2.0

1. Install the auto_complete plugin.
script/plugin install http://svn.rubyonrails.org/rails/plugins/auto_complete
2. Turn off CSRF protection. Read Ryan's post.

You will get ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7707/lib/action_controller/request_forgery_protection.rb:73

error if you don't turn it off.

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. If you don't want to turn off CSRF protection, the plugin is easy to patch so that it will work. I wrote this up and submitted it, but it hasn't been applied yet: http://dev.rubyonrails.org/ticket/10059

    ReplyDelete
  3. When you say autocomplete, what is your ruby editor?

    ReplyDelete
  4. Can you please write a small post on how to make this plugin work in an app with rails2?
    Lot of folks are having trouble with getting it to work, this would be of great help

    TIA

    ReplyDelete
  5. Agreed, this has been very frustrating for me for the last few days. This kind of thing makes rails look very bad and unstable. I'm still not sure how to turn off this forgery protection and get it working, some step by step instructions geared toward newer rails users would be much appreciated!
    Brian

    ReplyDelete