remote_form_for で :with オプションを使用することは可能ですか?
それは link_to_remote で動作し、API ドキュメントは :with が remote_ メソッドのいずれかで動作する必要があることを示しているようです。
これが私が使用しているコードであり、それが生成している出力です:
Link_to_remote (動作):
= 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 (機能しません)
= 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;">
このオプションで remote_form_for を取得する方法を知っている人はいますか?
parameters:Form.serialize(this)
それとも、現在のフォームから値を取得するために使用する必要があるため、remote_form_for によって無視されていますか?
乾杯デイブ・スマイリー