title: Rails scope params
body: <p>Trying to write a simple search using scope however I get a strange response and I was wondering if someone could explain my mistake. </p>
  
  <pre><code>  scope :sounds_like, -&gt; (item) { where('title ILIKE ?', "#{ params[:sounds_like] }%")}
  </code></pre>
  
  <p>And my controller looks like </p>
  
  <pre><code> def index
      @items = Item.sounds_like(params[:sounds_like])
   end
  </code></pre>
  
  <p>I get the following error when trying to search from an API.</p>
  
  <pre><code>NameError (undefined local variable or method `params' for #&lt;Class:0x00007ff553a054d8&gt;):
  </code></pre>
  
  <p>Is there any way of passing the params to the model without using the params passed from the form?</p>