zachinglis / crummy

Tasty breadcrumbs! Crummy is a simple and tasty way to add breadcrumbs to your Rails applications.
http://zachinglis.com
MIT License
358 stars 82 forks source link

html_list_separator is never used #27

Closed simonc closed 11 years ago

simonc commented 12 years ago

I see the html_list_separator option in the README but cannot find where and how it's supposed to be used in the code.

Is it a work in progress ? I'm trying to make crummy work with the twitter bootstrap and the separator seems to take place after the link, in a span.

kstevens715 commented 12 years ago

I'm trying to do the exact same thing. Any luck?

kstevens715 commented 12 years ago

After taking a look at the source code, I realized that it was possible to do this using block syntax. Here is a block that generates Twitter Bootstrap compatible breadcrumbs (git://gist.github.com/2706367.git):

<% render_crumbs do |crumbs| %>                                                  
  <ul class="breadcrumb">                                                        
  <% crumbs.each_with_index do |crumb, index| %>                                 
    <li>                                                                         
      <%= link_to *crumb %>                                                      
      <%= '<span class="divider">/</span>'.html_safe unless index >= crumbs.size - 1 %>
    </li>                                                                           
  <% end %>                                                                         
  </ul>                                                                             
<% end %>
simonc commented 12 years ago

Sorry, I didn't try too hard and created Ariane ;) Crummy is great but I needed more customization.

kstevens715 commented 12 years ago

Nice, I'll have to take a look at your project as well.

denniscastro commented 12 years ago

I try config.html_list_separator = '< li class="class_separator">|</ li>'.html_safe

works good.