title: Rails: How to find_by a field containing a certain string
body: <p>I have a model named Topic, that has a name as a field.</p>
  
  <p>So say I have a term I'm searching for, apple.</p>
  
  <p>If I do a </p>
  
  <pre><code>Topic.find_by_name("apple")
  </code></pre>
  
  <p>I get a record back with the name apple. That's good -- but how do I change find_by_name so that it can find "apple juice" as well as "apple" -- basically, find names that contain the original query or exactly match the original query?</p>
  
  <p><b>Edit:</b>
  Thanks for all the response. I guess I should've been a little more clear earlier, but what if I want to find by a variable name (obviously I'm not going to want to find by the name "apple" everytime :) )?</p>
  
  <p>How do I manipulate Topic.where to accommodate for this?
  So something like...</p>
  
  <pre><code>@topic = Topic.where(......., @name)
  </code></pre>