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
Here is the only method I could find but as a beginner I surely miss
Please, can someone give some hints?
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