Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Mon Sep 22 05:07:07 -0700 2008 | |
| |
README.markdown | Tue Aug 11 14:18:16 -0700 2009 | |
| |
init.rb | Tue Aug 11 14:18:16 -0700 2009 | |
| |
lib/ | Mon Sep 22 05:07:07 -0700 2008 | |
| |
test/ | Tue Aug 11 14:18:16 -0700 2009 |
has_breadcrumbs
has_breadcrumbs is a simple plugin that adds a breadcrumb object into
controllers and views.
INSTALATION
1) Install the plugin with script/plugin install git://github.com/fnando/has_breadcrumbs.git
USAGE
On your controller:
class ApplicationController < ActionController::Base
before_filter :add_initial_breadcrumbs
private
def add_initial_breadcrumbs
breadcrumb.add 'Home', root_path
end
end
class ThingsController < ApplicationController
def index
breadcrumb.add 'Things', things_path
end
end
You don't need to provide an URL; in that case, a span will be generated instead of a link:
breadcrumb.add 'Some page'
You can set additional HTML attributes if you need to:
breadcrumb.add 'Home', root_path,
:id => 'home',
:title => 'Go to the home page'
On your view (possibly application.html.erb):
<p>
You are here: <%= breadcrumb.display %>
</p>
You can set your own separator:
<p>
You are here: <%= breadcrumb.display('|') %>
</p>
NOTE
Is Ruby 1.9 ready!
MAINTAINER
- Nando Vieira (http://simplesideias.com.br)
LICENSE:
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.







