I’m sure this is really obvious but I’m feeling my way here with rails
(and Ruby) and have tried a couple of things without success. So, can
anyone tell me the best way to reverse order the retuen list of
ancestors.
In the controller I have:
@ancestors = @category.ancestors
which returns an array starting at the parent and ending with the root.
When I then loop through the array to create a breadcrumb list:
<% @ancestors.each do |ancestor| %>
<%= link_to h(ancestor.name), :action =>“show”, :id => ancestor.id %> >
<% end %>
I get the breadcrumb list but in the wrong order:
parent > grandparent > root
Should I be changing the order in the controller or the loop. If so, how
(zero Ruby skills, as you can prob tell – pickaxe book on order!)
Thanks
Chris T