Fix a DOM attachment bug in the scaffold generator's controller