Forum: Ruby on Rails Showing a menu from an array

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6ce7ffd357f24cdbf218a130fd1ef16c?d=identicon&s=25 Jolé (Guest)
on 2007-06-19 21:29
(Received via mailing list)

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

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

Any suggestions?
714df4094c6cc4a71b835b5ed3668f6b?d=identicon&s=25 Todd Fisher (Guest)
on 2007-06-19 21:33
(Received via mailing list)
You might find this useful, =>

And I bet you could implement something like the following:

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

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

This topic is locked and can not be replied to.