Fixed ruby loop on table