title: Ruby on Rails - Adding parent object to child?
body: <p>I have a user stored in a session which I would like to add as the owner of a comment.  Rather than having a hidden field for user_id, I would like to add the user before the comment is saved in the controller.</p>
  
  <p>What would be the best way to do this?</p>
  
  <pre><code>@comment = @post.comments.create(params[:comment])
  </code></pre>
  
  <p>Thanks.</p>