Returned values and consequent usage

I think I can have finally reduced my problem to something somebody can
help me with.

I am using auto_complete…

specifically the form command is…

<%= text_area_auto_complete_for :case_manager :name %>

I need to use the value derived here in my controller…

If I use…

cm = CaseManager.find(:first, :conditions => “name = ‘Thomas E Dewey’”)

it works. I need to substitute the value derived from auto_complete
above for Thomas E Dewey…

cm = CaseManager.find(:first, :conditions => “name = name”)
the lookup will always return record #1

cm = CaseManager.find(:first, :conditions => “name = :name”)
cm = CaseManager.find(:first, :conditions => “name = @name”)
cm = CaseManager.find(:first, :conditions => “name = case_manager_name”)
all give me errors syntax or operator or run-time errors

How do I get the value derived from auto_complete into a find command?

Craig

Are you referring to when it sends it back to the server via a form
post?

Not sure exactly what you want but try:

CaseManager.find(:first, :conditions => [“name = ?”, case_manager.name])

You can always fall back to the params:

CaseManager.find(:first, :conditions => [“name = ?”,
params[case_manager][name]])

Again, not sure where you are trying to “find” something using the value
of
the auto_complete field. Or are you trying to use this to populate the
auto_complete field?

Bob S.
http://www.railtie.net/