Hello!
I need some help. I am doing an auto complete that hast to find result from
a mysql database of some people if the text written in the text box matches
the name or last name. It works if i only want to find matches with the name
or indepently the secon name but not with a or of both.
I have this
@inscritos = Inscrito.find(:all,
:conditions => ["LOWER(nombre) LIKE ?",
'%' + params[:familiar]["0"].downcase + '%' ],
:order => 'apellido ASC',
:limit => 8)
this works fine but then i want something like this
@inscritos = Inscrito.find(:all,
:conditions => ["LOWER(nombre) OR LOWER(apellido) LIKE ?",
'%' + params[:familiar]["0"].downcase + '%' ],
:order => 'apellido ASC',
:limit => 8)
--
Felipe Vergara Contesse
IngenierĂa Civil Industrial UC
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---