title: break down a complex search query in Rails 3
body: <p>I have a controller which has a lot of options being sent to it via a form and I'm wondering how best to separate them out as they are not all being used simultaneously.  Ie sometimes no, tags, sometimes no price specified.  For prices I have a default price set so I can work around with it always being there, but the tags either need to be there, or not.  etc.</p>
  
  <pre><code>@locations = Location.find(params[:id])
  
  @location = @locations.places.active.where("cache_price BETWEEN ? AND ?",price_low,price_high).tagged_with([params[:tags]).order(params[:sort]).paginate :page =&gt; params[:page]
  </code></pre>
  
  <p>I haven't seen any good examples of this, but I'm sure it must happen often... any suggestions?  Also, even will_paginate which gets tacked on last should be optional as the results either go to a list or to a google map, and the map needs no pagination.</p>