Fix the erb bugs in the templates