title: Rails 4 undefined method 'to_key'
body: <p>I am trying to update the attributes of an existing client in postgresql. I want to search for a client name, then store that info in a cookie and redirect to the form. If I use</p>
  
  <pre><code>@client = Client.first
  </code></pre>
  
  <p>my code works fine. Everything is loaded up and I can update, however I want it to be something like </p>
  
  <pre><code>@client = Client.where(:id =&gt; 1)
  </code></pre>
  
  <p>This works in rails console but it does not work when in the view or the controller. I end up with the error <a href="https://i.stack.imgur.com/pGi5F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pGi5F.png" alt="Shitty rails error"></a></p>