Sha256: 3b0a81957462f7e13fe438b051421c4014d3b1faca45872bffdc3631d0551723

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

{<img src="https://badge.fury.io/rb/crumbs.png" alt="Gem Version" />}[http://badge.fury.io/rb/crumbs] {<img src="https://codeclimate.com/github/museways/crumbs.png" />}[https://codeclimate.com/github/museways/crumbs] {<img src="https://travis-ci.org/museways/crumbs.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/crumbs] {<img src="https://gemnasium.com/museways/crumbs.png" alt="Dependency Status" />}[https://gemnasium.com/museways/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 lambda, proc or block too, 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

3 entries across 3 versions & 1 rubygems

Version Path
crumbs-1.1.2 README.rdoc
crumbs-1.1.0 README.rdoc
crumbs-1.0.9 README.rdoc