title: Coffeescript JQuery on click only working when page is refreshed
body: <p>I have a rails app that's using coffeescript.  When I refresh the page or go to it directly using the URL, the following code works.  When I click a link through to this page and try it out, it doesn't work at all.  Why could that be?</p>
  
  <pre><code>jQuery -&gt;
    console.log "Ready."
    $('form').on 'click', '.add_fields', (event) -&gt;
      console.log "Click."
      time = new Date().getTime()
      regexp = new RegExp($(this).data('id'), 'g')
      $(this).before($(this).data('fields').replace(regexp, time))
      event.preventDefault()
  </code></pre>
  
  <p>After a reload, I get Ready and Click when appropriate, and it works.  After a click through from another page, I don't get anything.  I also get this deprecation warning from chrome, which I'm not sure how to fix since it's coming from within JQuery itself:</p>
  
  <pre><code>event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
  jquery.js?body=1:5375
  </code></pre>
  
  <p>The error only shows up when the code above isn't working.  Is chrome blocking it?  I'm using <code>jquery-rails (3.0.4)</code></p>