title: Complicated? Constructing a Model from other Models in Rails
body: <p>I have created scaffolds for a number of resources in a rails application, and these form the content for the system.</p>
  
  <p>What I need to do now is construct a form that lets a new user pick and choose the elements from the scaffolds, and then save this.  In effect, it is a configuration of the other resources.</p>
  
  <p>For example,</p>
  
  <p>I have four models:</p>
  
  <pre><code>class House &lt; ActiveRecord::Base
     has_many :windows 
     has_many :doors
  end
  
  class Window &lt; ActiveRecord::Base
     belongs_to :house
     has_many :locks
  end
  
  class Door &lt; ActiveRecord::Base
     belongs_to :house
     has_many :locks
  end
  
  class Lock &lt; ActiveRecord::Base
     belongs_to :window
     belongs_to :door
  end
  </code></pre>
  
  <p>An administrator has uploaded all the available Windows, Doors and Locks into the system.<br>
  I need to build a new house that has a selection of these.</p>
  
  <p>I hope there is a simple way to do this but I can't think of a clean way unfortunately.</p>