title: What's your most succinct way of checking param existence + value in Rails?
body: <p>I have an optional URL param, say "user_id" I need to check for. I know I can use </p>
  
  <p><code>if params.has_key?(:user_id) ...</code></p>
  
  <p>to do things based on the presence of the <code>user_id</code> parameter, but sometimes <code>user_id</code> is passed without a value, so I want to ignore it completely. To fight the issue, I find myself doing this a lot--but there's got to be a better way, right?</p>
  
  <pre><code>if params[:user_id] &amp;&amp; !params[:user_id].empty?
    # Do stuff
  end
  </code></pre>
  
  <p>It just seems really ugly.</p>