title: Nested models throws Undefined Method Error
body: <p>I've been following <a href="http://github.com/ryanb/railscasts-episodes/tree/master/episode-197" rel="nofollow noreferrer">RailsCast 197</a> to try this nested models/forms and have cracked my head over this code for over 2 hours, but to no avail.  What am I overlooking?</p>
  
  <p>I have the following Models:</p>
  
  <pre><code>class Workout &lt; ActiveRecord::Base
    belongs_to :user
    has_many :performed_exercises, :dependent =&gt; :destroy
    accepts_nested_attributes_for :performed_exercises
  end
  
  class PerformedExercise &lt; ActiveRecord::Base
    belongs_to :workout
    belongs_to :exercise
    has_many :performed_sets, :dependent =&gt; :destroy
    accepts_nested_attributes_for :performed_sets
  end
  
  class PerformedSet &lt; ActiveRecord::Base
    belongs_to :performed_exercise
  end
  </code></pre>
  
  <p>In my WorkoutsController I have the following:</p>
  
  <pre><code>  def new
      # We only need to build one of each since they will be added dynamically
      @workout = Workout.new
      @workout.performed_exercises.build
      @workout.performed_exercises.performed_sets.build
    end
  </code></pre>
  
  <p>When I run the test and invoke the controller in the browser, I get the following error:</p>
  
  <pre><code>undefined method `performed_sets' for #&lt;Class:0x7f6ef6fa6560&gt;
  </code></pre>
  
  <p>Thanks in advance for any help - my RoR noobility ceases to amaze me!</p>
  
  <p><strong>Edit</strong>:
  fflyer05: I tried using the same code as the RailsCast with the iterating over the collection, as well as attempting to build the performed_sets on performed_exercises[0] - but it doesn't work. Doing anything else, I get an uninitialized constant PerformedExercise::PerformedSet error</p>