#8 new
Zhang Jun

[PATCH] add authenticity_token in auto_complete

Reported by Zhang Jun | May 12th, 2008 @ 02:39 AM

I am using Rails 2.0.2 with auto_complete plugin

http://svn.rubyonrails.org/rails...

But even the example doesn't work. After googling, I found some discussions:

http://www.ruby-forum.com/topic/...

So, It seems this problem has been there for about half of a year.

I would like to create this ticket for fixing this bug in auto_complete/auto_complete_macros_helper.rb

Please see the patch in attachment

Comments and changes to this ticket

  • Mike Boone

    Mike Boone June 21st, 2008 @ 03:07 AM

    I agree that support for the authenticity_token is needed. I added a similar patch to my code today. However, the patch breaks the auto_complete_test.rb tests because protect_against_forgery?, request_forgery_protection_token, and form_authenticity_token are not defined in the test environment. A real test should probably test both protect_against_forgery? being true and false.

    If I get some free time I'll work on the tests.

  • Brian Doll

    Brian Doll July 18th, 2008 @ 09:04 PM

    • → Tag changed from “” to “patch plugin”

    For clarity, as mentioned in #154, specifying the method as a GET will work as well.

    ex:

    <%= text_field_with_auto_complete :object, "method", {}, {:method => :get} %>

  • Jose Fernandez

    Jose Fernandez July 30th, 2008 @ 07:49 PM

    #23 already addresses this issue and the testing

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments

Tags