Sorry to bother everyone again, but I’m trying to extend this
functionality just a little bit further before calling it a day.
user = User.find(current_user.id)
@contactss = user.contacts.find(:all,
:conditions => [ ‘LOWER(fullname) LIKE
?’,’%’ + value.downcase + ‘%’],
:order => ‘fullname ASC’,
:limit => 8)
render :partial => ‘contacts’ and return
As this stands right now, everything works. What I’m trying to do is
to have it search for multiple conditions and not just the fullname
field. For instance, there is a city field in the contacts table. I
would like a user to be able to type in the city and also have it
compare against that part of the table.
Unfortunately, I can’t seem to group off the first condition so that I
can use an OR to add a new one. ( ) draws a syntax error. " " kills the
functionality altogether. Is there another way?