title: Rails Routing with Query String
body: <p>I have a problem where I need values passed in from a GET request and I don't know how to set up the routing definition.</p>
  
  <p>My Category object has a type(string),a color(string) and many products.  I want to create a simple web service that lets the caller get all of a Category's products by passing in the Category's type and color:</p>
  
  <pre><code>http://www.myapp.com/getProducts?catType=toy&amp;color=red
  </code></pre>
  
  <p>or ?</p>
  
  <pre><code>http://www.myapp.com/categories/getProducts?catType=toy&amp;color=red
  </code></pre>
  
  <p>How do I define the correct routing for this situation?  Are there better ways to do this in a Restful manner... because I know that Rails is Restful, so if there is a way to do it "correctly" then that would be even better.</p>
  
  <p>Thanks</p>