Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi
I am trying to put an search option .... but when i try to search for database by
@get_user=User.find(:all, :conditions => ["name like ?",params[:name]+"%"])
My intesion is to find the user whose user name has a perticular string anyware in his name
thank you
Hi,
You need a '%' at both ends of the search string.
@user = User.find(:all, :conditions => [“name like ?â€, "%#{params[:name]}%“])
thank you for instantanious responce..
in my case im using Jon's syntax is working ...
im getting error with James's syntax... it is giving CAN'T CONVERT HASH WITH DIFFERENT ACCESS INTO STRING..
Thanks to both of you regards -rasheeed
