title: Rails 5 ask_as_taggable with select2
body: <p>I cannot see the effect of select2 in rails 5 form whether it's a text_field or select. does anyone know why the tag_list is not being populated. I can see that the tag_list has values but as you see in the snap below, it shows "No results found". Does select2 work with Rails 5 as I've tried several options?  <a href="https://i.stack.imgur.com/R1ht1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R1ht1.png" alt="enter image description here"></a></p>
  
  <p>form: Select all will display all values into the box</p>
  
  <pre><code>&lt;%= f.label :tags, "Tags (separated by commas)" %&gt;
  &lt;%= f.text_field :tag_list, value: f.object.tag_list.each { |e| e} %&gt;
  &lt;input type="checkbox" id="checkbox" &gt;Select All
  </code></pre>
  
  <p>I made the text field simple instead of select2 and was able to add tags in DB by adding <code>:tag_list</code> to strong params.</p>
  
  <p>application.js - </p>
  
  <p>Note: select2 didnot work o I used select2-full which I saw somewhere in Google.</p>
  
  <pre><code>//= require underscore
  //= require select2-full
  </code></pre>
  
  <p>JS code for select2</p>
  
  <pre><code>$(function() {
  $('input#post_tag_list').select2({tags:[], placeholder: "Choose a Tag", allowClear: true})
  </code></pre>
  
  <p>});</p>
  
  <p>Now, I checked with normal HTML &amp; JS it even worked with select2(or select2-full)</p>
  
  <pre><code>&lt;select multiple id="e1" style="width:300px"&gt;
     &lt;option value="A"&gt;Apple&lt;/option&gt;
     &lt;option value="B"&gt;Banana&lt;/option&gt;
     &lt;option value="G"&gt;Grapes&lt;/option&gt;
    &lt;/select&gt;
  
    &lt;input type="checkbox" id="checkbox" &gt;Select All 
  </code></pre>
  
  <p>And the corresponding JS code is:</p>
  
  <pre><code>$("#checkbox").click(function(){
  if($("#checkbox").is(':checked') ){
    $("#post_topic_list &gt; option").prop("selected","selected");
    $("#post_topic_list").trigger("change");
  }else{
    $("#post_topic_list &gt; option").removeAttr("selected");
    $("#post_topic_list").trigger("change");
  }
  </code></pre>
  
  <p>});</p>
  
  <p>Can someone point out if normal HTML select-input works with select2 why does it not have same functionality in rails 5? I tried with both bootstrap_form_for and form_for. I even read about turbolinks issue...how to tackle the issue with turbolinks not loading the select2?</p>