Javascript rails中的Jquery/coffee脚本500错误

Javascript rails中的Jquery/coffee脚本500错误,javascript,jquery,ruby-on-rails,ajax,coffeescript,Javascript,Jquery,Ruby On Rails,Ajax,Coffeescript,我对Jquery还不熟悉,我正在尝试理解一个rails应用程序。我有一个电子邮件表单,您发送发票,收件人可以对发票提出异议,但争议发送表单给出了500个错误 xhr.send( ( s.hasContent && s.data ) 及 当我刷新记录操作的页面时,发票显示为有争议,但应该发生的操作(实际发送通知和成功消息)没有发生 这是相关的js.erb文件 jQuery('#dispute_invoice_popup').modal('hide'); jQuery(".aler

我对Jquery还不熟悉,我正在尝试理解一个rails应用程序。我有一个电子邮件表单,您发送发票,收件人可以对发票提出异议,但争议发送表单给出了500个错误

xhr.send( ( s.hasContent && s.data )

当我刷新记录操作的页面时,发票显示为有争议,但应该发生的操作(实际发送通知和成功消息)没有发生

这是相关的js.erb文件

jQuery('#dispute_invoice_popup').modal('hide');
jQuery(".alert.alert-success").show().find('span').html("<%= escape_javascript @message %>");
jQuery('.response_to_client').html('<%= escape_javascript render("dispute_history") %>');
jQuery('#show_invoice_container').html('<%= escape_javascript render("show_invoice") %>');

正如我所说的,我是Jquery的新手,在这里我真的很茫然,我非常感谢任何帮助或建议。如果您需要任何其他信息,请告诉我。

如果没有适当的缩进,就不可能理解您的Coffeescript代码……您还应该包括收到的500个错误(至少包括stacktrace的前几行)
jQuery('#dispute_invoice_popup').modal('hide');
jQuery(".alert.alert-success").show().find('span').html("<%= escape_javascript @message %>");
jQuery('.response_to_client').html('<%= escape_javascript render("dispute_history") %>');
jQuery('#show_invoice_container').html('<%= escape_javascript render("show_invoice") %>');
<div class="dispute_popup">
<%= form_tag "/invoices/dispute_invoice",:class=>"dispute_form",:novalidate => "", :remote => true do %>
<div id="dispute_invoice_popup" class="modal hide fad" style="width:760px; min-height: 250px; left:43.4%;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="model_grey_container">
    <div class="modal-header">
      <h1><%= t('views.invoices.dispute_invoice') %></h1>
      <div class="cross_btn">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          <%= image_tag "cross.png", :size => "7x7", :alt => "" %>
        </button>
      </div>
    </div>
    <div id="invoice_popup_error" class="alert alert-error popup" style="display:none;">
      <button class="close" type="button" style="margin:0px;">×</button>
      <table>
        <tbody>
          <tr>
            <td>
              <span></span>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="modal-body">
      <%= hidden_field_tag "invoice_id", @invoice.id %>
      <div class="fields_content_data new_invoice_fields">
        <div class="field_row textarea">
          <div class="label_field textarea"><label><%= t('views.invoices.reason_for_dispute') %></label></div>
          <div class="large_field" style="clear:both;">
            <%= text_area_tag "reason_for_dispute" ,'',:required => ""%>
          </div>
        </div>
      </div>
    </div>
    <div class="footer ">
      <%= submit_tag t("views.common.send"), :class => "btn_large submit" %>
      <a class="btn_large grey" href="#" data-dismiss="modal"><%= t('views.common.cancel') %></a>
    </div>
  </div>
</div>
# dispute popup validation
jQuery("form.dispute_form").submit ->
flag = true
if jQuery("#reason_for_dispute").val() is ""
  applyPopover(jQuery("#reason_for_dispute"),"bottomMiddle","topLeft","Enter reason for dispute")
  flag = false
flag
jQuery("#reason_for_dispute").live "keyup", ->
jQuery(this).qtip("hide")

# Alert on dispute if invoice is paid
jQuery('#dispute_link').click ->
jQuery('#reason_for_dispute').val('')
flag = true
status = jQuery(this).attr "value"
if status is "paid"
  alert "Paid invoice can not be disputed."
  flag = false
flag

jQuery(".more").live "click", ->
jQuery(".toggleable").removeClass("collapse")