Storing search value in database

http://railscasts.com/episodes/37 --- Simple Search form

http://railscasts.com/episodes/111 --- Advanced Search