title: Rails4, Turbolinks, and select2: Object [object Object] has no method 'select2'
body: <p>Can someone help me with this, I get the error: </p>
  
  <pre><code>Object [object Object] has no method 'select2'
  </code></pre>
  
  <p>If i'm go through a link using turbolinks.
  But if I reload the page select2 works.</p>
  
  <p><strong>application.js</strong></p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require select2
  //= require foundation
  //= require turbolinks
  //= require_tree .
  
  $(function(){ $(document).foundation(); });
  </code></pre>
  
  <p><strong>events.js.coffee</strong></p>
  
  <pre><code>loadAdress = (json) -&gt;
      $("#event_adress").val json.adress + "\n" + (if json.zipcode? then json.zipcode else '') + ' ' + json.town
      $("#event_name").val json.name
      $("#event_cell_phone").val (if json.cellPhone? then '+45'+json.cellPhone else '') 
      $(".hidden").slideDown()
  
  ready = -&gt;
      if $("#event_contact_id").length &gt; 0
          $("#event_contact_id").select2
              width: "element"
              placeholder: "Find kunde"
          $("#event_contact_id").on "select2-selecting", (e) -&gt;
              $.ajax "/contacts/" + e.val + ".json",
              dataType: "json"
              success: loadAdress
  
  $(document).ready(ready)
  $(document).on('page:load', ready)
  </code></pre>
  
  <p>I hope someone can help me out with this, because I have tried to solve this for hours now.</p>