title: How to test if parameters exist in rails
body: <p>I'm using an IF statement in Ruby on Rails to try and test if request parameters are set.  Regardless of whether or not both parameters are set, the first part of the following if block gets triggered. How can I make this part ONLY get triggered if both params[:one] and params[:two] is set?</p>
  
  <pre><code>if (defined? params[:one]) &amp;&amp; (defined? params[:two])
   ... do something ...
  elsif (defined? params[:one])
   ... do something ...
  end
  </code></pre>