README.textile in crummy-1.2 vs README.textile in crummy-1.3

- old
+ new

@@ -4,36 +4,28 @@ Crummy is a simple and tasty way to add breadcrumbs to your Rails applications. h2. Install -The gem is hosted on gemcutter, so if you haven’t already, add it as a gem source: +Simply add the dependency to your Gemfile: <pre> <code> - gem sources -a http://gemcutter.org/ + gem "crummy", "~> 1.3" </code> </pre> -Then install the Crummy gem: +h3. Rails 2 +In your terminal, write: + <pre> <code> gem install crummy </code> </pre> -h3. Rails 3 / Bundler. - -Simply add gem dependency to your Gemfile: - -<pre> - <code> - gem "crummy", ">= 1.0.1" - </code> -</pre> - h2. Example In your controllers you may add_crumb either like a before_filter or within a method (It is also available to views). <pre> @@ -46,10 +38,13 @@ add_crumb("Businesses") { |instance| instance.send :businesses_path } add_crumb("Comments", :only => "comments") { |instance| instance.send :businesses_comments_path } before_filter :load_comment, :only => "show" add_crumb :comment, :only => "show" + # Example for nested routes: + add_crumb(:document) { [:account, :document] } + def show add_crumb @business.display_name, @business end def load_comment @@ -97,17 +92,16 @@ render_crumbs :separator => ' | ' #=> <a href="/">Home</a> | <a href="/businesses">Businesses</a> render_crumbs :format => :xml #=> <crumb href="/">Home</crumb><crumb href="/businesses">Businesses</crumb> render_crumbs :format => :html_list #=> <ul class="" id=""><li class=""><a href="/">Home</a></li><li class=""><a href="/">Businesses</a></li></ul> </code> </pre> -A crumb with a nil link will just output plain text. +A crumb with a nil argument for the link will output an unlinked crumb. + With :format => :html_list you can specify additional params: :active_li_class, :li_class, :ul_class, :ul_id h2. Notes -The variable set is set to @_crumbs as to not conflict with your code. - h2. Todo * Port over rspecs from project to plugin (Fully tested in a project) * Accept instances of models as a single argument * Allow for variables in names. (The workaround is to do your own before_filter for that currently) @@ -122,7 +116,9 @@ * "Sharad Jain":http://github.com/sjain * "Max Riveiro":http://github.com/kavu * "Kamil K. Lemański":http://kml.jogger.pl * "Brian Cobb":http://bcobb.net/ * "Kir Shatrov":http://shatrov.tk/ +* "sugilog":http://github.com/sugilog +* "Trond Arve Nordheim":http://github.com/tanordheim -*Copyright (c) 2011 Zach Inglis, released under the MIT license* +*Copyright (c) 2008-2011 Zach Inglis, released under the MIT license*