【发布时间】:2017-12-20 23:07:51
【问题描述】:
我按照教程 here 将 ajax 表单添加到我的 rails 应用程序。 一切正常,除了我没有收到无效表单的错误消息。当我检查谷歌浏览器控制台时,我得到了
Uncaught SyntaxError: Unexpected token :
at processResponse (rails-ujs.self-661556f….js?body=1:246)
at rails-ujs.self-661556f….js?body=1:173
at XMLHttpRequest.xhr.onreadystatechange (rails-ujs.self-661556f….js?body=1:230)
Failed to load resource: the server responded with a status of 422 (Unprocessable Entity)
Uncaught SyntaxError: Unexpected token :
at processResponse (rails-ujs.self-661556f….js?body=1:246)
at rails-ujs.self-661556f….js?body=1:173
at XMLHttpRequest.xhr.onreadystatechange (rails-ujs.self-661556f….js?body=1:230)
POST http://localhost:3000/people 422 (Unprocessable Entity)
【问题讨论】:
标签: jquery ruby-on-rails ajax twitter-bootstrap error-handling