title: Order sub-tree navigation using ancestry gem
body: <p>I'm following the rails cast <a href="http://railscasts.com/episodes/162-tree-based-navigation-revised" rel="nofollow">Tree Based Navigation</a>.</p>
  
  <p>I want to order the sub-tree alphabetically. </p>
  
  <p>In my PagesController I have</p>
  
  <pre><code>@page_for_nav = Admin::Page.find_by_permalink!(params[:id])
  </code></pre>
  
  <p>which gets called by</p>
  
  <pre><code>&lt;%= render 'layouts/sub_navigation', pages: @page_for_nav.root.descendants.arrange %&gt;
  </code></pre>
  
  <p>which renders</p>
  
  <pre><code>&lt;ul&gt;
    &lt;% pages.each do |page, children| %&gt;
      &lt;% if page.page_status == 'Public' %&gt;
      &lt;li&gt;
        &lt;%= link_to_unless_current page.name, "../#{page.permalink}" %&gt;
        &lt;%= render 'layouts/sub_navigation', pages: children if children.present? %&gt;
      &lt;/li&gt;
      &lt;% end %&gt;
    &lt;% end %&gt;
  &lt;/ul&gt; 
  </code></pre>
  
  <p>Doing this in my PagesController fails (no error given, it just doesn't order)</p>
  
  <pre><code>@page_for_nav = Admin::Page.order("name asc").find_by_permalink!(params[:id])
  </code></pre>
  
  <p>and doing this on the each which also fails (no error given, it just doesn't order)</p>
  
  <pre><code>&lt;% pages.each.order("name asc") do |page, children| %&gt;
  </code></pre>