title: Checking multiple params in Ruby
body: <p>These <code>params</code> come out of html inputs in erb templates (this code is in the main <code>application.rb</code>), and I am checking if they are filled before I add them to <code>n.requestusers</code>, which will become part of a database entry. It works, but it feels more like a bash script the way it is now. What would be the best way to write something like this? </p>
  
  <p><strong>a route in the main .rb</strong></p>
  
  <pre><code>if params[:user2].empty? &amp;&amp; params[:user3].empty? &amp;&amp; params[:user4].empty? &amp;&amp; params[:user5].empty?
    n.requestusers = params[:user1]
  elsif params[:user3].empty? &amp;&amp; params[:user4].empty? &amp;&amp; params[:user5].empty?
    n.requestusers = params[:user1], params[:user2]
  elsif params[:user4].empty? &amp;&amp; params[:user5].empty?
    n.requestusers = params[:user1], params[:user2], params[:user3]
  elsif params[:user5].empty?
    n.requestusers = params[:user1], params[:user2], params[:user3], params[:user4]
  else
    n.requestusers = params[:user1], params[:user2], params[:user3], params[:user4], params[:user5]
  end
  </code></pre>