README.md in gretel-3.0.7 vs README.md in gretel-3.0.8
- old
+ new
@@ -6,27 +6,10 @@
It is based around the idea that breadcrumbs are a concern of the view, so you define a set of breadcrumbs in *config/breadcrumbs.rb* (or multiple files; see below) and specify in the view which breadcrumb to use.
Gretel also supports [semantic breadcrumbs](http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417) (those used in Google results).
Have fun! And please do write, if you (dis)like it – [lassebunk@gmail.com](mailto:lassebunk@gmail.com).
-## New in version 3.0
-
-* Breadcrumbs can now be rendered in different styles like ul- and ol lists, and for use with the [Twitter Bootstrap](http://getbootstrap.com/) framework. See the `:style` option below for more info.
-* Defining breadcrumbs using `Gretel::Crumbs.layout do ... end` in an initializer has been removed. See below for details on how to upgrade.
-* The `:show_root_alone` option is now called `:display_single_fragment` and can be used to hide the breadcrumbs when there is only one link, also if it is not the root breadcrumb.
- The old `:show_root_alone` option is still supported until Gretel version 4.0 and will show a deprecation warning when it's used.
-* Links yielded from `<%= breadcrumbs do |links| %>` now have a `current?` helper that returns true if the link is the last in the trail.
-* New view helper: `parent_breadcrumb` returns the parent breadcrumb link (with `#key`, `#text`, and `#url`). This can for example be used to create a dynamic back link.
- You can supply options like `:autoroot` etc.
- If you supply a block, it will yield the parent breadcrumb if it is present.
-* Breadcrumbs can now be inferred if you pass in an instance of an object that responds to `model_name` (like an ActiveRecord model instance). E.g. `breadcrumb @product` is short for `breadcrumb :product, @product`.
-
-
-I hope you find these changes as useful as I did – if you have more suggestions, please create an [Issue](https://github.com/lassebunk/gretel/issues) or [Pull Request](https://github.com/lassebunk/gretel/pulls).
-
-See below for more info or the [changelog](https://github.com/lassebunk/gretel/blob/master/CHANGELOG.md) for less significant changes.
-
## Installation
In your *Gemfile*:
```ruby
@@ -82,11 +65,11 @@
This will generate the following HTML (indented for readability):
```html
<div class="breadcrumbs">
- You are here:
+ <span class="pretext">You are here:</span>
<a href="/">Home</a> ›
<a href="/issues">All issues</a> ›
<span class="current">My Issue</span>
</div>
```
@@ -145,11 +128,11 @@
end
# Parent crumbs
crumb :project_issues do |project|
link "Issues", project_issues_path(project)
- parent :project, project
+ parent project # inferred to :project
end
# Child
crumb :issue do |issue|
link issue.name, issue_path(issue)
@@ -158,20 +141,20 @@
# Recursive parent categories
crumb :category do |category|
link category.name, category
if category.parent
- parent :category, category.parent
+ parent category.parent # inferred to :category
else
parent :categories
end
end
# Product crumb with recursive parent categories (as defined above)
crumb :product do |product|
link product.name, product
- parent :category, product.category
+ parent product.category # inferred to :category
end
# Crumb with multiple links
crumb :test do
link "One", one_path
@@ -188,10 +171,10 @@
crumb :product do |product|
if keyword = params[:q].presence
parent :search, keyword
else # default
- parent :category, product.category
+ parent product.category # inferred to :category
end
end
# Multiple arguments
crumb :multiple_test do |a, b, c|