Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用RubyonRails进行JQuery验证_Jquery_Ruby On Rails_Json_Validation - Fatal编程技术网

使用RubyonRails进行JQuery验证

使用RubyonRails进行JQuery验证,jquery,ruby-on-rails,json,validation,Jquery,Ruby On Rails,Json,Validation,我无法从以下位置获取错误消息: format.json { render json: @contactmail.errors, status: :unprocessable_entity } 我的一些文本字段的实时JQuery验证 当JQuery方法datatype设置为text时,它会在呈现新页面后打印出我想要验证的页面的所有html。如果数据类型是JSON,Firebug会给我一个错误422,并用我的错误消息打印类似对象的内容 有没有关于如何用正确的方法做这件事的线索

我无法从以下位置获取错误消息:

format.json { render json: @contactmail.errors, status: :unprocessable_entity }
我的一些文本字段的实时JQuery验证

当JQuery方法datatype设置为text时,它会在呈现新页面后打印出我想要验证的页面的所有html。如果数据类型是JSON,Firebug会给我一个错误422,并用我的错误消息打印类似对象的内容

有没有关于如何用正确的方法做这件事的线索