weppos / breadcrumbs_on_rails

A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation.
https://simonecarletti.com/code/breadcrumbs-on-rails
MIT License
944 stars 188 forks source link

Use custom Builder as default for an application? #34

Closed coxandrew closed 4 years ago

coxandrew commented 12 years ago

Is there a way to make a custom Builder the default for an app? Not the default for the gem, but just on a specific application?

I'm using the BootstrapBreadcrumbsBuilder, which is a great option, but using the :builder option every time is a little cumbersome:

<%= render_breadcrumbs :builder => BootstrapBreadcrumbsBuilder %>

I thought I might be able to just rename my class to SimpleBuilder to overwrite the default, but that didn't work. Are there any other ways to allow me to just write render_breadcrumbs and have it use my Builder?

weppos commented 11 years ago

Currently, it's not possible by default. You can achieve it by creating a custom render_breadcrumbs that sets the default builder and call super.

weppos commented 11 years ago

I will probably make this feature available in a future release.

coxandrew commented 11 years ago

Sounds good - thanks!

d-natoli commented 11 years ago

Looks like a duplicate of https://github.com/weppos/breadcrumbs_on_rails/pull/41

drale2k commented 6 years ago

+1 for this

weppos commented 4 years ago

Closing for now. It's possible to define a custom helper which sets the desired default behavior.