title: Adding a new record with a self join in Rails
body: <p>I have a self join on an object "thing"    </p>
  
  <pre><code>class Thing &lt; ActiveRecord::Base  
      has_many :children, :class_name =&gt; "Thing", :foreign_key =&gt; "parent_id"  
      belongs_to :parent, :class_name =&gt; "Thing"    
  end
  </code></pre>
  
  <p>When I view a Thing I want to provide a link to the new thing page to create a child object with the parent_id populated with the id of the current Thing, so I thought I would use this</p>
  
  <pre><code>&lt;%= link_to 'New child thing', new_thing_path(@thing) %&gt;
  </code></pre>
  
  <p>but that doesn't work as the default action is to the GET method in the controller which can't find the :id in the params with</p>
  
  <pre><code>@thing = Thing.find(params[:id])
  </code></pre>
  
  <p>so the question is;</p>
  
  <p>a) should I have a new controller for children or;<br>
  b) is there a better way to send the param of the parent_id through to the GET method in the Thing controller</p>
  
  <p>Thanks in advance</p>
  
  <p>Heath.</p>