Created
May 16, 2012 00:47
-
-
Save kstevens715/2706367 to your computer and use it in GitHub Desktop.
Generates Twitter Bootstrap compatible breadcrumbs with the Crummy gem.
Sorry..
<% 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 %>
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
Hi, I changed the li's positions...
<% render_crumbs do |crumbs| %>
<% crumbs.each_with_index do |crumb, index| %> <% if index < crumbs.size - 1 %>-
<%= link_to *crumb %>
/
<% else %>
- <%= crumb[0] %>
<% end %>
<% end %>
<% end %>