Moved ajaxSubmit function to application.js