Sha256: feeee00b7acf18e2a1d73b6b1a58b91bc9d3a2ee1de7eb39bd557196f2ba3f8a
Contents?: true
Size: 1.69 KB
Versions: 1
Compression:
Stored size: 1.69 KB
Contents
# Breadcrumble [![Build Status](https://secure.travis-ci.org/ma2gedev/breadcrumble.png?branch=master)](http://travis-ci.org/ma2gedev/breadcrumble) Breadcrumble is a simple breadcrumb navigation plugin for Ruby on Rails 3 and Rails 4.0. ## Installation Add this line to your application's Gemfile: gem 'breadcrumble' And then execute: $ bundle Or install it yourself as: $ gem install breadcrumble ## Usage ### Controller In your controller, call `add_breadcrumb` to push a new crumb on the breadcrumb stack. class SampleController add_breadcrumb "home", home_url add_breadcrumb -> context { context.title }, -> context { context.sample_path } def index add_breadcrumb "index", controller: 'sample', action: 'index' add_breadcrumb "show", show_path(123) add_breadcrumbs ["book", "/book"], ["page", "/book/page"] end end Second arugment passed url_for method for convenient use, except specify nil. You can use Proc object for arguments, the library calls proc with controller context as argument. ### View In your view, you can render the breadcrumb navigation with the `render_breadcrumbs` helper. <body> <%= render_breadcrumbs %> </body> ### Customizing layout Breadcrumble generates default partial template for your app. Generate template. Run the follwoing. $ rails g breadcrumble:views then edit the partials in your app's `app/views/breadcrumble/` directory. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
breadcrumble-3.0.2 | README.md |