Referencing a table


#1

I am trying to use auto_complete_for to reference a different table.

in my clients_controller.rb file

auto_complete_for :case_manager :case_manager.name
^^^^^^^^^^^^
this is not the clients table

my models/clients.rb has:
has_one: case_manager

The above ‘auto_complete_for’ line in clients_controller.rb generates
the following error when I attempt to access clients/index.html

How can I make this work?

SyntaxError in #
./script/…/config/…/app/controllers/clients_controller.rb:3: syntax
error
auto_complete_for :case_manager :case_manager.name
^

RAILS_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:inload’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in
require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:independ_on’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in
require_dependency' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:inload_file!’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:97:in
const_load!' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:inconst_load!’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:72:in
const_missing' routing.rb:234:intraverse_to_controller’
generated/routing/recognition.rb:3:in eval' generated/routing/recognition.rb:3:inrecognize_path’


#2

auto_complete_for :case_manager :case_manager.name

I believe it should be:
auto_complete_for :case_manager, :name

Joey