Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tag: v.2.2.0
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (59 sloc) 3.05 KB

Breadcrumbs On Rails

BreadcrumbsOnRails is a simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project. It provides helpers for creating navigation elements with a flexible interface.


  • Rails 3

Please note

  • BreadcrumbsOnRails 2.x requires Rails 3. Use BreadcrumbsOnRails 1.x with Rails 2.
  • BreadcrumbsOnRails doesn't work with Rails 2.1 or lower.


RubyGems is the preferred way to install BreadcrumbsOnRails and the best way if you want install a stable version.

$ gem install breadcrumbs_on_rails

Specify the Gem dependency in the Bundler Gemfile.

gem "breadcrumbs_on_rails"

Use Bundler and the :git option if you want to grab the latest version from the Git repository.

Basic Usage

Creating a breadcrumb navigation menu in your Rails app using BreadcrumbsOnRails is really straightforward.

In your controller, call add_breadcrumb to push a new element on the breadcrumb stack. add_breadcrumb requires two arguments: the name of the breadcrumb and the target path.

class MyController

  add_breadcrumb "home", :root_path
  add_breadcrumb "my", :my_path

  def index
    # ...

    add_breadcrumb "index", index_path


The third, optional argument is a Hash of options to customize the breadcrumb link.

class MyController
  def index
    add_breadcrumb "index", index_path, :title => "Back to the Index"

In your view, you can render the breadcrumb menu with the render_breadcrumbs helper.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <%= render_breadcrumbs %>

render_breadcrumbs understands a limited set of options. For example, you can pass change the default separator with the :separator option.

  <%= render_breadcrumbs :separator => ' / ' %>

More complex customizations require a custom Builder.

Read the documentation to learn more about advanced usage and builders.




BreadcrumbsOnRails is Copyright (c) 2009-2012 Simone Carletti. This is Free Software distributed under the MIT license.

Jump to Line
Something went wrong with that request. Please try again.