Skip to content

Instantly share code, notes, and snippets.

@kstevens715
Created May 16, 2012 00:47
Show Gist options
  • Save kstevens715/2706367 to your computer and use it in GitHub Desktop.
Save kstevens715/2706367 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| %>
<li>
<% if index < crumbs.size - 1 %>
<%= link_to *crumb %>
<span class="divider">/</span>
<% else %>
<li class="active"><%= crumb[0] %></li>
<% end %>
</li>
<% end %>
</ul>
<% end %>
@philfreo
Copy link

You can just do this instead of making a custom template:

<%= render_crumbs :last_crumb_linked => false, :format => :html_list, :ul_class => 'breadcrumb', :last_class => 'active' %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment