Showing a menu from an array

Hi,

I want to show a menu on my page. The menu items are fetched from an array called menu_pages.

What I would like to accomplish is this -> blog | photos | movies

I'm using "|" in my view as a separator. The problem is that my current solution shows blog | photos | movies |... The last "|" is obsolete.

This is my code: <ul>   <% for page in @menu_pages %>     <li><a href=""><%=page%></a></li>     <% if @menu_pages.next %>       <li">|</li>     <% end %>   <% end %> </ul>

Any suggestions?

You might find this useful, => http://www.igvita.com/blog/2007/03/15/block-helpers-and-dry-views-in-rails/

And I bet you could implement something like the following:

<% menu_for @menu_pages do|menu| %> menu.page <% end %>

Although, for menus you might, not need to allow customization of each menu element…

Todd