它与link_to_remote一起工作,api文档似乎表明:with应该与任何远程方法一起工作。
链接到远程(工程):
= link_to_remote 'ARGH', {:url => {:action => 'load_item', :id => @policy.id} , :with => "'elephant=mouse'"}
<a href="#" onclick="new Ajax.Request('http://localhost:3000/quote_edit/load_item/5', {asynchronous:true, evalScripts:true, parameters:'elephant=mouse' + '&authenticity_token=' + encodeURIComponent('o6whEDZLuq1b1NsuZXIlNjc3iudZNC8jU+ZxgUDXFUk=')}); return false;">arg</a>
远程表单(不工作)
= remote_form_for :policy, @policy, :url => {:action => 'load_item', :id => @policy.id} , :with => "'elephant=mouse'" do |f|
<form action="http://localhost:3000/quote_edit/load_item/5" method="post" onsubmit="new Ajax.Request('http://localhost:3000/quote_edit/load_item/5', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;">
有人知道如何使用此选项制作远程表单吗?
parameters:Form.serialize(this)
要从当前表单中提取值?
干杯