I've had similar issues to this, and I've tended to use what I call a condition builder.
So, assuming you've got:
* params[:search] contains the string the user is searching for
* params[:city], params[:state] and params[:county] will contain something if the checkbox is checked, and nothing if they're not. (Is that right? I haven't had a coffee yet, and haven't checked this! :-D)
* city, state and county are fields in your database that you wish to search
Then you could build a condition array, and use it, like this:
condition_builder = [""]
["city","state","county"].each do |check|
# Append an "or" on run 2+
condition_builder << " or " if !condition_builder.empty?
# Append what we want to search to the query string
condition_builder << check + " = ?"
# Append the search criteria to the condition array
condition_builder << params[:search]
@foo = Items.find(:all, :condition => condition_builder)
There's not much error checking going on there - you'd want to ensure they've actually ticked some tick boxes for a start - possibly by checking !condition_builder.empty? - and give them a nice error.
I run into this problem quite often - I regularly want drop down lists that filter search results (e.g. "Show All Clients", "Show Live Clients", "Show Prospective Clients" etc.) - which is a simliar (if not identical) case - so if anyone has a better solution than mine, I'd like to hear about it.