title: jQuery token input not display data tags rails
body: <p>I am trying to use the <code>jQuery token-input</code> gem in my rails application. I have got it working as expected except for the data load part. When I create a <code>plan</code> with multiple <code>materials</code>, and save it, it creates the record like it is suppose to. </p>
  
  <p>When I go back to edit that plan, no materials are showing up. However, the data is being pre-loaded in the browser as I can see from the source code seen below. </p>
  
  <pre><code>&lt;input data-tokeninput="{&amp;quot;collection&amp;quot;:[{&amp;quot;id&amp;quot;:2,&amp;quot;title&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;goal&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;material_type&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;sharing&amp;quot;:false,&amp;quot;description&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;unit_id&amp;quot;:null,&amp;quot;created_at&amp;quot;:&amp;quot;2018-04-24T21:40:58.000Z&amp;quot;,&amp;quot;updated_at&amp;quot;:&amp;quot;2018-04-24T21:40:58.000Z&amp;quot;,&amp;quot;grade_id&amp;quot;:6,&amp;quot;user_id&amp;quot;:1,&amp;quot;subject_id&amp;quot;:6,&amp;quot;attachment_file_name&amp;quot;:null,&amp;quot;attachment_content_type&amp;quot;:null,&amp;quot;attachment_file_size&amp;quot;:null,&amp;quot;attachment_updated_at&amp;quot;:null}]}" type="text" name="plan[material_tokens]" id="plan_material_tokens" style="display: none;"&gt;
  </code></pre>
  
  <p>Does anybody know why this is not displaying the data in the field? </p>
  
  <p><b>Plans.coffee</b></p>
  
  <pre><code>jQuery -&gt;
    $('#plan_material_tokens').tokenInput('/materials.json', { propertyToSearch: 'title' });
    prePopulate: $('#plan_material_tokens').data('load')
  </code></pre>
  
  <p><b>_form.html.erb</b></p>
  
  <pre><code>&lt;%= form_for @plan do |form| %&gt;
    &lt;div class="form-group"&gt;
      &lt;%= form.label :name %&gt;
      &lt;%= form.text_field :name, class: 'form-control' %&gt;
    &lt;/div&gt;
  
    &lt;div class="form-group"&gt;
      &lt;%= form.label :material_tokens, "Materials" %&gt;
      &lt;%= form.text_field :material_tokens, data: { load: @plan.materials }%&gt;
    &lt;/div&gt;
  
    &lt;%= form.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><b>Materials controller</b>(where it is pulling the json data from)</p>
  
  <pre><code>def index
    @materials = current_user.materials
  
    respond_to do |format|
      format.html
      format.json { render json: @materials.where("title LIKE ?", "%#{params[:q]}%") }
    end
  end
  </code></pre>