title: How can I pass two params from controller to model in Ruby on Rails?
body: <p>I want to pass two params that I am introducing in an input en the index view. This is what i have in the index (the style doesn´t matter):</p>
  
  <pre><code>&lt;form action="/cars" method="GET"&gt;
        &lt;input type="text" name="from" placeholder="From" value="&lt;%= @from %&gt;"/&gt;
        &lt;input type="text" name="to" placeholder="To" value="&lt;%= @to %&gt;"/&gt;
        &lt;input style="color:white; border-radius: 2px; padding: 10px; margin-right: 20px; font-family: 'Montserrat', sans-serif; background-color: black; " type="submit", value="SUBMIT" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>After this, in the cars_controller I have the following:</p>
  
  <pre><code>if params[:from] &amp;&amp; params[:to]
        @cars = @cars.filter(params[:from, :to])
  end
  </code></pre>
  
  <p>Finally in my model, i have my function that works with The :from and :to params in a specific way to filter the cars, it doesn´t matter what´s inside. My method is like the following:</p>
  
  <pre><code>def filter(from, to)
  end
  </code></pre>
  
  <p>So the problem comes when, in the index view, I introduce the :from ant :to params by hand, press teh submit button and it returns me "wrong number of arguments (given 2, expected 1)"</p>