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?
on 2007-06-19 21:29
on 2007-06-19 21:33
You might find this useful, => http://www.igvita.com/blog/2007/03/15/block-helper... 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