title: Creating a new object when creating another
body: <p>I have 3 models: account, player_team and team. Player team serves to associate accounts and teams. Player_team table has account_id and team_id attributes. When I create the team,  i should at least have the account who created it belonging to the team. What am i doing wrong ?Any help would be appreciated, Thanks. </p>
  
  <pre><code>        def create
          @team = Team.new(team_params)
          @team.save
          @team_player = current_account.player_teams.build(:account_id =&gt; current_account.id, :team_id =&gt; @team.id)
          @team_player.save
          respond_with(@team)
        end
  
  class Account &lt; ActiveRecord::Base
    has_many :player_teams
    has_many :teams, through: :player_teams
  
  class Team &lt; ActiveRecord::Base
    has_many :player_teams
    has_many :accounts, through: :player_teams
  end
  
  class PlayerTeam &lt; ActiveRecord::Base
    belongs_to :account
    belongs_to :team
  end
  </code></pre>