我正在尝试将其转换为 Rails 3
<%= form_remote_tag :url => feedback_url,
:update => 'flash_message',
:before => "doSomething()",
:condition => "condition()",
:complete => "doSomethingElse();" -%>
这是我到目前为止所拥有的
<%= form_tag feedback_url, :remote => true, :id => 'form' do %>
<%# Gather data %>
<% end -%>
<script>
$(function() {
$("#form").bind("ajax:beforeSend", function() {
doSomething();
}).bind("ajax:success", function() {
doSmomethingElse();
});
});
});
</script>