title: Trying to figure out Ruby on Rails remote: true callbacks
body: <p>So I've been googling on how to set them up, I ended up with this code in the end.</p>
  
  <pre><code>&lt;script&gt;
  
  $('#reportform')
      .bind("ajax:success", function(data, status, xhr) {
          $('#reportalert').text('Done.');
      });
      .bind("ajax:error", function(xhr, status, error) {
  
          $('#reportalert').text('Failed.');
  
      });
  
  &lt;/script&gt;
  
  
  &lt;h2&gt;Review Driver&lt;/h2&gt;
  &lt;p&gt;Fill out your review of the driver&lt;/p&gt;   
  
  &lt;div class="hero-unit form-signin" id="reportformdiv"&gt;
  
      &lt;%= form_for(@report, html: { id: "reportform" }, remote: true, update: 
      { success: "response", failure: "error"} ) do |t| %&gt;
  &lt;p id="reportalert"&gt;&lt;/p&gt;
      &lt;%= t.text_field  :plant_site,    placeholder: "Plant Site" %&gt;
  
      &lt;%= t.text_field  :route_number,  placeholder: "Route Number" %&gt;
  
      &lt;%= t.text_field  :driver_name,   placeholder: "Driver name if available" %&gt;
  
      &lt;%= t.date_select :date_recorded, html: { class: "input-block-level" } %&gt;
  
      &lt;%= t.text_field  :action,        placeholder: "Action taken" %&gt;
  
      &lt;%= t.text_area   :report_body,   placeholder: "What you witnessed",
                                       style: "height: 300px;",
                                       class: "input-block-level" %&gt;
  
      &lt;%= t.submit     "File Report",  class: "btn btn-primary btn-large" %&gt;
  
      &lt;% end %&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>But it is not working and I have no idea why, I'm sure I've done something wrong, I'm new to RoR and I love the fact that I can declare this remote: true in the form its self, once I figure out how to set the callbacks I'll be good to go :) Thanks in advance.</p>