For a recent project I had to construct an advanced search page with some ranges and some select boxes, all of which are optional.  The difficulty came in figuring out a way to construct a proper SQL query from the options provided.  I hacked one together that works for the time being, but I would like to know how this is done properly.  Does anyone have any links to references where this is explained, preferably in a Ruby/Rails setting, but other languages would be fine as well.
<br><br>Thanks in advance,<br>--Tyler Prete<br>