Yes,Thanks a lot Andrew. The last two lines were not commented in routes.rb because of that it was matching default.Now i commented out those line and it was catching if undefined routes are given. -- Posted via http://www.ruby-forum.com/.