[![Build Status](https://secure.travis-ci.org/lassebunk/gretel.png)](http://travis-ci.org/lassebunk/gretel) Gretel is a [Ruby on Rails](http://rubyonrails.org) plugin that makes it easy yet flexible to create breadcrumbs. Installation ------------ In your *Gemfile*: ```ruby gem 'gretel', '2.0.0.beta1' ``` And run: ```bash $ bundle install ``` Example ------- Start by generating an initializer: ```bash $ rails generate gretel:install ``` Then, in *config/initializers/breadcrumbs.rb*: ```ruby Gretel::Crumbs.layout do # Root crumb crumb :root do link "Home", root_path end # Regular crumb crumb :projects do link "Projects", projects_path end # Parent crumbs crumb :project_issues do |project| link "Issues", project_issues_path(project) parent :project, project end # Child crumb :issue do |issue| link issue.name, issue_path(issue) parent :project_issues, issue.project end # Multiple links per crumb (recursive links for parent categories) crumb :category do |category| parents = [category] parent_category = category while parent_category = parent_category.parent_category parents.unshift parent_category end parents.each do |category| link category.name, category end parent :categories end # Product crumb with recursive parent categories crumb :product do |product| link product.name, product parent :category, product.category end # Multiple arguments crumb :multiple_test do |a, b, c| link "Test #{a}, #{b}, #{c}", test_path parent :other_test, 3, 4, 5 end end ``` At the top of *app/views/issues/show.html.erb*, set the current breadcrumb: ```erb <% breadcrumb :issue, @issue %> ``` Then, in *app/views/layouts/application.html.erb*: ```erb <%= breadcrumbs :pretext => "You are here: ", :separator => " › ", :semantic => true %> ``` This will generate a `