title: Constructing routing lines for large tree structure using the ancestry gem
body: <p>I am using the <a href="https://github.com/stefankroes/ancestry" rel="nofollow noreferrer">ancestry</a> gem and have followed the railscasts episode <a href="http://railscasts.com/episodes/262-trees-with-ancestry" rel="nofollow noreferrer">here</a> to get the gem to work, which works perfectly.</p>
  
  <p>I have created a fairly large ancestry tree, and although the parents and children are nested by indenting the fields, i prefer some sort of routing lines. The picture below show the small part of the total tree.</p>
  
  <p><img src="https://i.stack.imgur.com/hUnwy.png" alt="enter image description here"></p>
  
  <p><b>I would like to have a structure look like this/ or something similar</b></p>
  
  <p><img src="https://i.stack.imgur.com/KoxPk.png" alt="enter image description here"></p>
  
  <p>I tried to play around with the structure by adding lines, but i just seem to end up in smoke.</p>
  
  <p>Each parent and child is given a separate div field like this(in a helper). just like the railscasts episode.</p>
  
  <pre><code>def nested_messages(messages)
    messages.map do |message, sub_messages|
      render(message) + content_tag(:div, nested_routes(sub_messages), :class =&gt; "nested_messages")
    end.join.html_safe
  end
  </code></pre>
  
  <p>How can this be done, if possible. Any hints?</p>