title: rails autocomplete tags separated by commas using regex
body: <p>I am using the old <a href="https://github.com/rails/auto_complete" rel="nofollow">auto_complete plugin</a> in conjunction with the <a href="https://github.com/mbleigh/acts-as-taggable-on" rel="nofollow">acts as taggable on</a> gem in an attempt to basically replicate the tagging behavior of Stack Overflow itself! I am more or less doing what is described in this <a href="http://railscasts.com/episodes/102-auto-complete-association" rel="nofollow">rails cast</a>. For single tags, this works great.  However, I would really like to make it so that every time the user enters a space or a comma (much like on Stack Overflow), the autocomplete will start anew.  I'd imagine there is some way to do this via regex, but I'm not sure how to go about applying this behavior to the text_field (I'd imagine using JavaScript to "restart" the autocomplete, but admittedly I am fairly weak when it comes to JavaScript.  This is what my view looks like:</p>
  
  <pre><code>&lt;%= text_field_with_auto_complete :business, :tags, {}, { :url =&gt; formatted_businesses_path(:js), :method =&gt; :get, :with =&gt; "'search=' + element.value" } %&gt;
  </code></pre>
  
  <p>My controller is very straightforward, simply saving the tags for that particular business.</p>
  
  <p>If someone could point me in the right direction (As I'm not sure how to go about doing this) I would greatly appreciate it.</p>