Skip to content

Instantly share code, notes, and snippets.

@ffscalco
Forked from kstevens715/_breadcrumbs.html.erb
Created December 10, 2012 18:44
Show Gist options
  • Save ffscalco/4252438 to your computer and use it in GitHub Desktop.
Save ffscalco/4252438 to your computer and use it in GitHub Desktop.
Generates Twitter Bootstrap compatible breadcrumbs with the Crummy gem.
<% render_crumbs do |crumbs| %>
<ul class="breadcrumb">
<% crumbs.each_with_index do |crumb, index| %>
<% if index < crumbs.size - 1 %>
<li>
<%= link_to *crumb %>
<span class="divider">/</span>
</li>
<% else %>
<li class="active"><%= crumb[0] %></li>
<% end %>
<% end %>
</ul>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment