使用 js 响应表单提交,得到:ActionController::UnknownFormat



这是控制器代码:

respond_to do |format|
if user
format.js { render js: 'enter_your_password()' }
else
format.js { render js: 'check_your_email()' }
end
end

当我通过提交表单调用它时,出现此错误:

ActionController::UnknownFormat

要发出 ajax 请求,表单按钮必须remote: truelocal: false

相关内容

  • 没有找到相关文章

最新更新