title: How to parse param comma separated string ids to has_many mongoid field
body: <p>How to handle <code>tag_ids</code> in post params to save it in related model? I would like to use for it only <code>post_params</code> method.</p>
  
  <pre><code>has_many :tags
  
  def post_params
    params.require(:post).permit(:title, :message, :tag_ids)
  end
  
  #Parameters: {"post"=&gt;{"title"=&gt;"asdf", "message"=&gt;"asfd", "tag_ids"=&gt;"543d727a4261729ecd000000,543d8a914261729ecd010000"}}
  </code></pre>
  
  <p>I've got:</p>
  
  <pre><code>Mongoid::Errors::InvalidValue -
  Problem:
    Value of type String cannot be written to a field of type Array
  </code></pre>
  
  <p>I found solution but I don't like it, in Post model I've added:</p>
  
  <pre><code>def tag_ids=str
    str.split(',').each do |id|
      t = Tag.find(id)
      self.tags &lt;&lt; t
    end
  end
  </code></pre>