[Solved] Convert string to XXX
[ad_1] What you need is hash and not string. You can use it like this, hash = {id: 2} User.where(hash) And if you really want to use string you can do it like this, string = “id = 2” User.where(string) If you want to execute the string you can use eval. In that case it … Read more