[Rails] returned values and consequent usage

Bob Silva
Sun, 29 Jan 2006 09:07:37 -0000

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 Silva
http://www.railtie.net/

> -----Original Message-----
> From: rails-bounces@lists.rubyonrails.org [mailto:rails-
> bounces@lists.rubyonrails.org] On Behalf Of Craig White
> Sent: Saturday, January 28, 2006 11:40 PM
> To: rails@lists.rubyonrails.org
> Subject: [Rails] 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
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails