Ransack allows you to easily build complex search forms. It also helps in adding sortable links and building a dynamic advanced search page.

Read more at the source