Forum: Ruby on Rails auto_complete works sometimes...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fa06489a97b0efe3c3b7d249982878d3?d=identicon&s=25 David Hughes (divotdave)
on 2006-05-04 06:31
Hello All:

I have set up an auto_complete search field within my application
controller and application layout so that it is available to all pages
in my app. I have run into a snag with this in two projects I am working
on where it won't work on one particular page related to a specific

I get a No Method error on the column name referenced in the
auto_complete arguments, even though the column name is set correctly
and the feature works on every other page in the app...not sure why. Any

Fa06489a97b0efe3c3b7d249982878d3?d=identicon&s=25 David Hughes (divotdave)
on 2006-05-04 06:36
Figured it out straight away...the model referenced in the auto_complete
arguments was in the singular (client), but I had also created a
variable @client in the controller method for that page to call some
other data from the client table. This seemed to cause a conflict with
the auto_complete call. By changing @client to @clients in the
controller it worked.

Maybe this will help someone. Anybody know why exactly it caused the
error in the first place?

This topic is locked and can not be replied to.