new Ajax.Request('/hello',
{
method : 'post',
parameters :
{
text : old_text
}
,
asynchronous : true,
onSuccess : function(transport)
{
alert(transport.responseText);
this.setValue(transport.responseText);
$('php?name=editor" onclick="tagshow(event)" class="t_tag">editor_switch_spinner').hide();
}
.bind(this)
}
);上面一段代码,如果将Post改成Get,则没有任何问题,但是可能请求的内容很多,所以用Get方式不是很合适.
但用Post时,则会报如下异常:
ActionController::InvalidAuthenticityToken in HelloController#hello
ActionController::InvalidAuthenticityToken
求解答!