title: Combine multiple models in a Rails form to create a new object
body: <p>I have two models, Story and Category. Using the form for <code>Story#new</code>, I'd like to be able to save the foreign key for Category.</p>
  
  <p>To display the selection data from Category on the <code>Story#new</code> form page I've used:</p>
  
  <p><code>&lt;%= collection_select(:category , :category, Category.all , :id, :category, {:prompt =&gt; 'Select Category...'}) %&gt;</code></p>
  
  <p>How can I save <code>category_id</code> to the newly created Story object?</p>
  
  <hr>
  
  <p>Story has attributes: <code>industry_id</code> and <code>user_id</code>, Category has attribute <code>name</code>
  development.log tells me this: (it looks like it's trying to add a new category (99) to the Categories table</p>
  
  <pre><code>Started POST "/stories" for 127.0.0.1 at 2012-02-10 17:32:56 -0600
   Processing by StoriesController#create as HTML
  story"=&gt;{"industry_id"=&gt;"8", "user_id"=&gt;"8"}, "category"=&gt;{"category"=&gt;"99"}, "commit"=&gt;"Create Story"}
  </code></pre>