Hi thanks for all your suggetions. my problem solved by using sort 
method

-- 
Posted via http://www.ruby-forum.com/.