Forum: Rails France mysql like %%

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ded69cf5d54a478f0e2301f5aac80a92?d=identicon&s=25 Alexis Perrier (Guest)
on 2008-10-06 12:33
(Received via mailing list)
Bonjour

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
Alexis
047a4fc673336a70a6b58338bc6d677d?d=identicon&s=25 Michel Belleville (Guest)
on 2008-10-06 12:55
(Received via mailing list)
Essaye ça :

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


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