This is follow up to #6643. In #6643, the controller generator only had been fixed, in this commit to fix the scaffold generator.