title: How to properly use params.require in Rails
body: <p>I've read <a href="http://blog.trackets.com/2013/08/17/strong-parameters-by-example.html" rel="nofollow noreferrer">several</a> | <a href="http://api.rubyonrails.org/classes/ActionController/Parameters.html" rel="nofollow noreferrer">articles</a> about using <code>params.require(...)</code> in Rails, but nothing that shows them in a non-trivial, real-world scenario.</p>
  
  <p>Specifically, the following URL will be called:</p>
  
  <pre><code>GET http://myapp.example.com/widgets/{clientUuid}
  </code></pre>
  
  <p>Where <code>{clientUuid}</code> will be a string. I just want to check (from the proper controller action) whether the provided <code>{clientUuid}</code> is non-null and non-empty. I'm wondering if I can just do this:</p>
  
  <pre><code>if params.require(params[:clientUuid]) == null
    response = { "error" =&gt; "bad client uuid" }
    render json: response, status: :bad_request
    return
  end
  </code></pre>
  
  <p>And have non-nullness/non-emptiness enforced? If not, what can I do to achieve my desired result?</p>