Building advanced search in ruby on rails

hi,
i am trying to build and advance search functionality for my
application. I am able trying to build a form that passes the parameters
to a filter method which will use both the find and exists name like
methods to find what i am searching for.
Can you write down a good line of code that can perform this search
action.
regards
mo