title: Linked List Dependent Select Boxes
body: <p>So I haven't been doing this for long but I'm completely stuck on this.  I have a model which looks like this (simplified for brevity):</p>
  
  <pre><code>class ReqBreakdown &lt; ActiveRecord::Base
    belongs_to :next_level #nil if lowest level
    belongs_to :previous_level #nil if highest level
    belongs_to :requirement_level
  end
  </code></pre>
  
  <p>I need a way to build these lists from the UI.  I had initially envisioned using linked drop-downs like those described here: <a href="http://blog.jatinder.me/2006/09/cascading-select-boxes-with-rjs.html" rel="nofollow noreferrer">http://blog.jatinder.me/2006/09/cascading-select-boxes-with-rjs.html</a> but I can't even get it to call the action on my controller.  I copied the described javascript into my application.js, made sure it was included in my layout, added the helper to application_helper.rb, and added the supporting actions to my controller, but no luck.  Honestly, I'm not even sure it will meet my requirements.
  The rules for selection are:</p>
  
  <ol>
  <li>Up to 4 levels (i.e. 4 select boxes).</li>
  <li>No circular references (i.e. all previously selected items must be removed from the next text-box to be selected)</li>
  <li>Selected objects are all of the same type (requirement_level)</li>
  </ol>
  
  <p>Any suggestions?</p>