0
date_selectでAJAXを使用すると、パラメータとして渡された値はパラメータとして変更された値 になりますが、各フィールドの値も必要です。Ajaxの問題日付選択の変更値
例
DATESELECT
2011年6月5日=> 2011年6月6日に変更しなくAJAX値だけ値 "6" PARAMSに渡します。
日、月、年が必要です。
私のコード のform_forビュー <%(@operation、:URL => submit_cancellation_admin_operation_path)やる| | F > <% = f.error_messages%>
<p>Fecha de Pago:<br/><br/>
<%= date_select("", :payment_date, {:start_date => Time.now - 10}, {:onchange =>"#{remote_function(:url => {:controller => 'operations', :action => "update_payment_date"}, :with => "'payment_date='+value")}"}) %>
</p>
<% end %>
%コントローラーに
def cancel
@operation = Operation.find(params[:id])
last_pagare = Pagare.find(:first, :conditions => "operation_id = #{@operation.id} AND state <> 'cancelled'")
#The condition unless is because the last_pagare could be nil if the operation is totally cancelled
@punitive_ammount = @operation.get_punitive(DateTime.now.to_date, last_pagare.expiration_date.to_date) unless last_pagare.nil?
end
def update_payment_date
#Here I take the params
end
おかげで、私はこの問題を解決するためのjQueryを使用し
すみませんが、AHAXはAJAX – maxiperez
私はこの問題を解決する方法を解決する必要があります – maxiperez