# Search using 6 criteria

**URL:** <https://www.ruby-forum.com/t/search-using-6-criteria/119979>\
**Category:** Rails\
**Created:** [November 12, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/search-using-6-criteria/119979 "2007-11-12T17:15:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@martinr](https://www.ruby-forum.com/u/martinr)\
**Post date:** [November 12, 2007, 5:15pm UTC](https://www.ruby-forum.com/t/search-using-6-criteria/119979/1 "2007-11-12T17:15:35Z")

</div>

i want to search using 6 criteria

suburb bedroom garage

id name id name id name

1 all 1 all 1 all  
2 aeroglen 2 1 2 1  
3 whitfield 3 2 3 2  
4 edgehill 4 3 4 3 or more  
5 manunda 5 4  
6 manoora 6 5 or more

the first search should check to see if the suburb ID  
if ID = 1 search all suburbs  
else return only selected suburb

then  
check to see if the bedroom ID  
if ID = 1 search all bedrooms  
else return only selected bedroom

then

check to see if the garage ID  
if ID = 1 search all garages  
else return only selected garages

i have tried various ways and cannot get it to work

any suggestions

Martin
