[Rails] Re: querying multiple rows from db in my simple search

2009-08-16 Thread g_f
:conditions = ['body LIKE?' AND 'title LIKE?', %#{search}%] Try fixing the condition clause to: :conditions = ['body LIKE ? AND title LIKE ?', %#{search}%, %# {search}% ] You are passing an array containing the SQL WHERE clause in a template. Each '?' is a placeholder for the

[Rails] Re: querying multiple rows from db in my simple search

2009-08-16 Thread Philip Gavrilos
g_f wrote: :conditions = ['body LIKE?' AND 'title LIKE?', %#{search}%] Try fixing the condition clause to: :conditions = ['body LIKE ? AND title LIKE ?', %#{search}%, %# {search}% ] You are passing an array containing the SQL WHERE clause in a template. Each '?' is a placeholder