title: How to accept attributes for models that don't have an active record association?
body: <p>I'm making a simple team allocation app. I have three models - Players, Teams and Rounds. The idea is to have a list of players from which a user can select those who are actually there on the day to play in a round. So far I have the code that takes all the current players in the db and randomly allocates them to a team (the teams are created when a round is created). </p>
  
  <pre><code>class Player &lt; ActiveRecord::Base
    has_and_belongs_to_many :teams
  end
  
  class Team &lt; ActiveRecord::Base
    has_and_belongs_to_many :players
    belongs_to :round
  end
  
  class Round &lt; ActiveRecord::Base
    has_many :teams
  end
  </code></pre>
  
  <p>I've written a function that is called during round create to create and populate teams. That's working fine, but it is just getting the input list of players from <code>Player.all</code>. </p>
  
  <p>What I would like is in <em>rounds/new.html.erb</em> to have something like this: </p>
  
  <pre><code>&lt;%= f.fields_for(@players) do |player| %&gt;
    &lt;%= check_box_tag 'player_ids[]', player.id, true %&gt;
    &lt;%= player.first_name %&gt; &lt;%= player.surname %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>That way on <code>submit</code> I can process the array of selected users for this round and only assign those players to a team. I thought about using   </p>
  
  <pre><code>accepts_nested_attributes_for :players
  </code></pre>
  
  <p>in the rounds model, but it doesn't actually have (or need) an association with the players. Is there a way I can achieve this or something similar? Should I instead setup an action in the players controller that manages the checkbox view/submit and then store the user's selection in session data? </p>