Closed dgarwood closed 4 years ago
for completeness, here's how i'm referencing the customer builder in layouts/application.rb
...
<div class="row">
<ul class="breadcrumbs">
<%= render_breadcrumbs builder: ApplicationHelper::MyBuilder, tag: :li, separator: ''%>
</ul>
</div>
...
Closing as not actionable, keeping as example. Thanks for sharing it @dgarwood.
I have a situation where the site CSS requires a specific CSS class added to the final element of the breadcrumb to result in a non-clickable link. Adding
, option: {class: "class_name"}
to the end of theadd_breadcrumb
call works fine for every element except the last one.When adding breadcrumb elements like this:
default builder output looks like:
Due to CSS formatting on the site, I need output like:
Here's my new custom generator, the only difference is adding the element.options to the end of the
@context.content_tag
call:Haven't had a chance to write any tests on this, not sure if it would be helpful to everyone. Wanted to list this so that a) there's a clearer example of setting up a custom builder and b) reference this so myself or someone else can make a PR for this if desired.