README.md in gretel-2.2.0.rc1 vs README.md in gretel-2.2.0.rc2
- old
+ new
@@ -203,14 +203,14 @@
<% end %>
<% end %>
<% end %>
```
-Setting custom breadcrumb trails
+Setting breadcrumb trails
--------------------------------
-You can set a custom breadcrumb trail via `params[:trail]`. This makes it possible to link to a different breadcrumb trail than the one specified in your breadcrumb.
+You can set a breadcrumb trail via `params[:trail]`. This makes it possible to link to a different breadcrumb trail than the one specified in your breadcrumb.
An example is if you have a store with products that have a default parent to their category, but when linking from the review section, you want to link back to the reviews instead.
### Initial setup
@@ -244,9 +244,17 @@
<%= link_to @product.name, product_path(product, trail: breadcrumb_trail) %>
<% end %>
```
The product view will now have the breadcrumb trail from the first page (reviews) instead of its default parent.
+
+### Custom trail param
+
+The default trail param is `params[:trail]`. You can change it in an initializer:
+
+```ruby
+Gretel::Trail.trail_param = :other_param
+```
### Note
Please use the trail functionality with care; the trails can get very long.