OK, I was given the complete solution. I have the following pieces of 
code:

controller:

@thematized_pages = @page.children.group_by(&:theme)

view:

<% @thematized_pages.each do |theme, pages| -%>
  <h3><%= theme ? theme.name : 'Others' %></h3>
  <ul>
  <% pages.each do |page| %>
    <li><%= link_to h(page.title), 
h(page.parent.link_name+'/'+page.link_name) %></li>
  <% end -%>
  </ul>
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to