title: Rails nested form not rendering
body: <p>I'm guessing this is more of a fundamental issue than the form simply "not rendering", but here it goes. I'll try to keep this brief but a fair amount of context may be needed.</p>
  
  <p>I'm making a custom Rolodex app and the organization gave me specific things to include. <strong>For this specific problem I'm dealing with contact emails only.</strong> Ideally I would have a system like Google Contact's, where you can click to add another email field and there's a dropdown to select a category (Home, Work, etc.).</p>
  
  <p>In this case the categories are coming from a table called categories. Here is a link to the entity relationship diagram I made for the entire project (not just emails): <a href="http://i.imgur.com/LNSWZHy.jpg" rel="nofollow">http://i.imgur.com/LNSWZHy.jpg</a></p>
  
  <blockquote>
    <p><strong>To sum things up: How do I set things up to allow the entry of emails during a contact creation/edit?</strong></p>
  </blockquote>
  
  <p>Here's my relevant code:</p>
  
  <p><strong>models/contact.rb</strong></p>
  
  <pre><code>class Contact &lt; ActiveRecord::Base
    has_many :emails
  
    accepts_nested_attributes_for :emails
  end
  </code></pre>
  
  <p><strong>models/email.rb</strong></p>
  
  <pre><code>class Email &lt; ActiveRecord::Base
    belongs_to :contact
    belongs_to :category
  end
  </code></pre>
  
  <p><strong>controllers/contacts_controller.rb</strong></p>
  
  <pre><code># GET /contacts/new
    def new
      @contact = Contact.new
      @email = @contact.emails.build(params[:email])
    end
  </code></pre>
  
  <p><strong>views/contacts/_form.html.erb</strong></p>
  
  <pre><code>&lt;%= form_for(@contact) do |f| %&gt;
  
      #Other contact fields here
  
      &lt;% f.fields_for @email do |email| %&gt;
          &lt;div class="field"&gt;
            &lt;%= email.label :category_id %&gt;&lt;br&gt;
            &lt;%= email.text_field :category_id %&gt;&lt;br/&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
            &lt;%= email.label :email %&gt;&lt;br&gt;
            &lt;%= email.text_field :email %&gt;&lt;br/&gt;
          &lt;/div&gt;
      &lt;% end %&gt;
      &lt;div class="actions"&gt;
        &lt;%= f.submit %&gt;
      &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I also confirmed that this whole setup works "manually". I can make contacts and categories, and then properly reference them when creating a new email by manually putting in the foreign ids. The issue here is a matter of condensing this process into one form.</p>
  
  <p>Any input would be appreciated, thanks!</p>