title: Rails autocomplete with acts-as-taggable-on issue
body: <p>I am a rails newbie. I am trying to implement acts-as-taggable-on with autocomplete. The problem I am facing is if I have multiple tags for a user, autocomplete suggests the entire tag_list instead of a single tag. </p>
  
  <p>This is a follow up question with <a href="https://stackoverflow.com/questions/8575153/activerecordrelation-issue-on-acts-as-taggable-on/8577661#8577661">ActiveRecord::Relation issue</a> I faced earlier &amp; solved with help from <a href="https://stackoverflow.com/users/219883/taryn-east">Taryn East</a>.</p>
  
  <p>I want autosuggest to suggest me only Grey &amp; Green Tags instead of Grey, White. I think its suggesting me Grey, White because I created those tags for something else before, so its taking the entire array instead of a single record in an array. </p>
  
  <p><img src="https://i.stack.imgur.com/VGtHu.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/5Qq90.png" alt="enter image description here"></p>
  
  <p>How can I overcome this issue &amp; ask it to suggest me only a single tag &amp; no multiple tags?</p>
  
  <p>This is what I got.</p>
  
  <p>_form.html.erb</p>
  
  <pre><code>&lt;%= form_for(@user) do |f| %&gt;
  &lt;%= f.label :name %&gt;
  &lt;%= f.text_field :name %&gt;
  &lt;%= f.label :tags %&gt;
  &lt;%= f.autocomplete_field :tag_list, autocomplete_tag_name_users_path, :"data-delimiter" =&gt; ', ' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>index.html.erb</p>
  
  <pre><code>&lt;% @users.each do |user| %&gt;
   &lt;h3&gt;&lt;%= user.name %&gt;&lt;/h3&gt;
   &lt;h4&gt;&lt;i&gt;&lt;%= user.tag_list %&gt;&lt;/i&gt; | &lt;%= time_ago_in_words(user.created_at) %&gt; ago&lt;/h4&gt;
   &lt;h4&gt;&lt;%= link_to 'Show', user %&gt; | &lt;%= link_to 'Edit', edit_user_path(user) %&gt; | &lt;%= link_to 'Delete', user, confirm: 'Are you sure?', method: :delete %&gt;&lt;/h4&gt;
  &lt;% end %&gt;
  
  &lt;h1&gt;Listing All Tags [&lt;%= @smart.map(&amp;:name).length %&gt;]&lt;/h1&gt;
  &lt;ul&gt;
  &lt;% @smart.each do |tag| %&gt;
  &lt;li&gt; &lt;%= tag.name %&gt;&lt;/li&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>new.html.erb is</p>
  
  <pre><code>&lt;h1&gt;New user&lt;/h1&gt;
  &lt;%= render 'form' %&gt;
  &lt;%= link_to 'Back', users_path %&gt;
  </code></pre>
  
  <p>user.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    serialize :tags
    acts_as_taggable_on :tags
    scope :by_join_date, order("created_at DESC")  
  end
  </code></pre>
  
  <p>users_controller.rb</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
  autocomplete :tag, :name, :class_name =&gt; 'ActsAsTaggableOn::Tag'
  
  def index
      @users = User.all
      @smart = User.tag_counts_on(:tags)
  end
  
  def new
      @user = User.new
  end
  end
  </code></pre>
  
  <p>How can I overcome this issue &amp; ask it to suggest me only a single tag &amp; no multiple tags? Thanks a lot in advance.</p>