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
On 6/19/07, Jolé
<jelle.vandebeeck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> 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 received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---