Sha256: f2045440b35bd869ed573af8c01b9b95b3bd5220836eab2bb3a1a7e08f9f24c8

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

{<img src="https://codeclimate.com/github/mattways/crumbs.png" />}[https://codeclimate.com/github/mattways/crumbs] {<img src="https://travis-ci.org/mattways/crumbs.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/crumbs] {<img src="https://gemnasium.com/mattways/crumbs.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/crumbs]

= Crumbs

Adds a handy crumbs variable available in your views.

= Install

Put this line in your Gemfile:
  gem 'crumbs'
  
Then bundle:
  $ bundle  
  
= Usage
  
In your controllers add crumbs to the actions you want to have a crumb:
  crumb :home, 'Home'

You can use a proc if you want, will receive the corresponding url parameters:
  crumb :product, proc { |params| Product.find(params[:id]).name }
  
Then in your views would be available a crumbs variable:
  <% @crumbs.each do |crumb| %>
    &gt; <%= link_to crumb[:name], crumb[:path] %>
  <% end %>

= Configuration

If you want to show the last crumb, put this in your application.rb:
  config.crumbs.show_last = true

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crumbs-1.0.7 README.rdoc