title: Rails: A subform that when submitted updates a field in parent form
body: <p>I have a form that looks like this :</p>
  
  <pre><code>&lt;%= form_for :game do |game_form| %&gt;
          &lt;%= game_form.label :app_game_id %&gt;
          &lt;%= game_form.select :app_game_id, @available_app_games.collect {|p| [ p.name, p.id ] } %&gt;
        ....
  </code></pre>
  
  <p>Where <code>@available_app_games</code> is given from the controller, and it looks at other models different from Game.  The user is supposed to select on of those <strong>app_games</strong> from the drop down, but he should also be able to create a new app_game.
  A form for an app_game should contain just <strong>name</strong> and <strong>description</strong></p>
  
  <p>I have two questions:</p>
  
  <p>How would I create this sub form that would create a new app_game, and how would I update the:</p>
  
  <pre><code>&lt;%= game_form.select :app_game_id, @available_app_games.collect {|p| [ p.name, p.id ] } %&gt;
  </code></pre>
  
  <p>With this new submitted <strong>app_game</strong> ?</p>