mercredi 19 août 2020

How to get data from database with specific combination of name

I am working on ruby on rails project and I need to get data from the database with a specific combination like c*_c*_othername * can be numbered 1,2,3 etc like c1_c1_anystring. Prefix c is fixed for all time. I am trying with following code but it's not working

Topic.where("name like ?", "%c*_c*_*%")

Aucun commentaire:

Enregistrer un commentaire