这是控制器代码:
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: true
或local: false
。