ok, so probably best if i just paste code and then explain
search = "your horses"
exp1 = ""
exp2 = ""
myarray = search.split(/ /)
mylength = myarray.length #this would return 2 in this case
mylength.times do
exp1 += "AND name LIKE ? " #this gives--> AND name LIKE ? AND name LIKE ?
end
for i in 0..(mylength - 1)
exp2 += ("%#{myarray[i]}%, ") #and this gives--> your, horses,
end
find(:all, :conditions => ["#{exp1}", exp2])
and here at the end i get a problem because exp2 becomes 'your, horses,' inside the find function. what do i have to do that inside these conditions there would be no additional single quote marks inserted?
or maybe i should do it some other way?
thank you very much for your answers!