我使用的是Rails 2.3.8,有一个jQueryAjax表单,使用:
jQuery.fn.submitWithAjax = function() {
this.submit(function() {
jQuery.post(this.action, $j(this).serialize(), null, "script");
return false;
});
return this;
};
如果我试图发布一个包含引号的文本,比如
1
"2"
3
只有引号中的内容作为参数接收:
Parameters: {"contact_id"=>"1", "action"=>"create", "note"=>{"note"=>"2"}, "controller"=>"notes"}
知道为什么吗?
更新:这是表格
<form action="/contacts/1/notes" class="note_form" id="note_create_form" method="post">
<p><textarea class="autogrow" cols="40" id="note_note" name="note[note]" rows="20"></textarea></p>
<p><input class="submitbut" name="commit" type="submit" value="Add this Note" /> </p>
</form>