Forum: Rails France mysql like %%

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alexis P. (Guest)
on 2008-10-06 14:33
(Received via mailing list)

Je n'arrive pas à trouver comment exprimer la condition suivante dans
une requete

email like '%#{params[:email]}%'

sous la forme

:conditions => ["  email like %?% ",params[:email] ]

Avec l'exemple ci dessus, j'obtiens trop de simples guillemets  entre
les %%, la requete n'est pas valide

Merci de votre aide
Michel B. (Guest)
on 2008-10-06 14:55
(Received via mailing list)
Essaye ça :

:conditions => ["  email like ? ","%#{params[:email]}%" ]

Michel B.
This topic is locked and can not be replied to.