From: arnaud stageman Date: 2006-06-13T17:32:41+09:00 Subject: ugly ruby code... Hello! When I look at this method and when I think to pursuit of beauty thanks Ruby, I think I could do a nicer bunch of code... I would like to seperate racks already added in the showed room and the others Here is the only method I could find but as a beginner I surely miss some tricks! Please, can someone give some hints? [code] def show @room = Room.find(params[:id]) @racks = Rack.find( :all ) @racks_room = Array.new @free_racks = Array.new for rack in @racks do if rack.room_id == @room.id @room_s_racks << rack else @free_racks << rack end end end [/code] -- Posted via http://www.ruby-forum.com/.