Fix broken has_many form html and javascript