% collapsed = links.length > 4 %>
<% if collapsed %>
<% first_link = links.shift
last_links = links.pop(2) %>
<%= link_to(first_link[:label], first_link[:url],
class: "breadcrumbs-link #{first_link[:class]}",
title: first_link[:label],
data: first_link[:data]) %>
/
•••
/
<% last_links.each do |link| %>
<%= link_to(link[:label], link[:url],
class: "breadcrumbs-link #{link[:class]}",
title: link[:label],
data: link[:data]) %>
/
<% end %>
<% else %>
<% links.each do |link| %>
<%= link_to(link[:label], link[:url],
class: "breadcrumbs-link #{link[:class]}",
title: link[:label],
data: link[:data]) %>
/
<% end %>
<% end %>