title: Splitting text_field by commas for nested, polymorphic tagging form
body: <p>I have a tag model that is polymorphic, and which is also nested under microposts (so that the user can submit both the micropost and tag in the same "form for").</p>
  
  <p>So far, the form submits successfully, and the micropost saves and the tag saves to my tags table.</p>
  
  <p>However, what I want to do is split whatever is submitted in the tags text_field (where it says "jobs, engineering" below) into separate tags and split it with a split(", ")</p>
  
  <p>Here is the POST console output when i click the submit button:</p>
  
  <pre><code>Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"T/GieqxRM7Kxl2jmC7hr3KPixM/jVG4pdMi/ceb1Vq0=", "micropost"=&gt;{"content"=&gt;"This is a post", "tags_attributes"=&gt;{"0"=&gt;{"name"=&gt;"jobs, engineering"}}}, "commit"=&gt;"Post"}
  </code></pre>
  
  <p>Would the best way to do this to write it into the "Create" method in the micropost controller (and if so, can someone point me in the right direction)? </p>
  
  <p>(Note: I saw that there was a related question but I think they were using HAML so I didn't follow it)</p>
  
  <p>Also, I'm not sure why the <code>0</code> shows up as a hash key. I think it might be because I put this below in my <code>form_for(@micropost)</code>, but if I don't put it there my tag text_field disappears. </p>
  
  <pre><code>% @micropost.tags.build %
  </code></pre>