// Replace the form with the updated one containing errors document.querySelector('#new_student, .edit_student').innerHTML = '<%= j render "form", student: @student %>';