How does one write a prepared statement with LIKE using find_by_sql.
For example the problem with soemthing like this is that extra quotes are put around the ? Product.find_by_sql(["SELECT * FROM products WHERE name LIKE '%?%'"], params[:name])
Thanks John
Perhaps you could try Product.find_by_sql(["SELECT * FROM products WHERE name LIKE ?"], "%#{params[:name]}%")
Not positive it'll work though.
Pat
Thank you Pat. Your solution worked