Clean up your header navigation in Ruby on Rails

Use an array. Like the below.

<% links_array = [{title: "test", link_text: "Test", link: linky}, {title: "test2", link_text: "Test2", link: linky}] %>

Then to show the links place the below in the “ul” tags.

<% links_array.each do | l | %>
<li<%= sanitize is_active(yield(:title), l[:title]) %>><%= link_to l[:link_text], l[:link] %>
<% end %>

You can make more then one array for different sections. Or you could store it in the database.