title: Rails/SQL - How to search for partial match and get results?
body: <p>This is the code for the location search field of a real estate search site:</p>
  
  <pre><code>   scope :location, lambda{|l|  where("city LIKE ? OR zip_code LIKE ? OR address LIKE ?", l, l, l)}
  </code></pre>
  
  <p>But I have to put the complete city name or zip code or address to get results, how do I fix it so that I can search for just 2 or 3 letters or numbers and get results that contain those letters or numbers? I tried wrapping the l like this: '%l%' but no luck.</p>