title: unknown attribute: admin_id with nested views and has_many relationships
body: <p>Basically my issue is that when trying to use nested views in my rails application I need to store both general users and admins for a page.  Both contain the same information I just need to know who is whom.  I have a Team model: </p>
  
  <pre><code>class Team &lt; ActiveRecord::Base
    attr_accessible :auth_token, :team_name, :template
    has_many :events, :dependent =&gt; :destroy
    has_many :users
    has_many :admins, :class_name =&gt; "User", :foreign_key =&gt; 'admin_id'
    accepts_nested_attributes_for :admins
  end
  </code></pre>
  
  <p>And my schema for the Teams table contains an admin_id field. I do not understand why I am getting this error.  I have tried quite a bit of googling and searching through forums and despite finding some similar issues I couldn't find all of the same combinations of issues that I was having.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>EDIT</strong>
  User Model:    </p>
  
  <pre><code>class User &lt; ActiveRecord::Base
      require 'digest/sha1'
      attr_accessor :pre_pass
      belongs_to :team
      attr_accessible :name, :player
      attr_protected :password
      validates :name, :presence =&gt; true
      validates :pre_pass, :presence =&gt; true
      before_save :encrypt_pass
      after_save :clear_pre_pass
  end
  </code></pre>
  
  <p>Teams/new View</p>
  
  <pre><code>&lt;%= form_for(@team) do |f| %&gt;
    &lt;% if @team.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h2&gt;&lt;%= pluralize(@team.errors.count, "error") %&gt; prohibited this team from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% @team.errors.full_messages.each do |msg| %&gt;
          &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :team_name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :team_name %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :template %&gt;&lt;br /&gt;
      &lt;%= f.number_field :template %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :auth_token %&gt;&lt;br /&gt;
      &lt;%= f.number_field :auth_token %&gt;
  &lt;/div&gt;
      &lt;p&gt;
          &lt;%= f.fields_for :admins do |builder| %&gt;
              &lt;%= render "admin_fields", :f =&gt; builder %&gt;
          &lt;% end %&gt;
      &lt;/p&gt;
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Error
      ActiveRecord::UnknownAttributeError in TeamsController#new</p>
  
  <pre><code>unknown attribute: user_id
  </code></pre>
  
  <p>app/controllers/teams_controller.rb:28:in `new'</p>
  
  <p>TeamController#new </p>
  
  <pre><code>def new
      @team = Team.new
      @team.admins.build
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @team }
      end
  end
  </code></pre>