Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


fix name collision #54

wants to merge 1 commit into from

3 participants


the method breadcrumbs is too common, i use Spree( and it overrides the method "breadcrumbs", so this is suggestion to solve this kind of issues.


I think it makes sense. To push it even further, I suggest to use breadcrumbs_on_rails instead of breadcrumbs_collection so that we prevent every possible issue.

Moreover, the main method should be breadcrumbs_on_rails including the instance variable

def breadcrumbs_on_rails
    @breadcrumbs_on_rails ||= []

and it should be aliased as breadcrumbs. Do you mind to make the changes?


Please also make sure to provide the corresponding test.


What is the current state of this PR? I could help to implement this as I it need for a projects i'm working on.


I've done the suggested changes on #65. Please take a look and let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 26, 2014
  1. @justame

    fix name collision

    justame authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/breadcrumbs_on_rails/action_controller.rb
8 lib/breadcrumbs_on_rails/action_controller.rb
@@ -14,18 +14,20 @@ module ActionController
included do
extend ClassMethods
helper HelperMethods
- helper_method :add_breadcrumb, :breadcrumbs
+ helper_method :add_breadcrumb, :breadcrumbs_collection
def add_breadcrumb(name, path = nil, options = {})
- self.breadcrumbs <<, path, options)
+ self.breadcrumbs_collection <<, path, options)
def breadcrumbs
@breadcrumbs ||= []
+ alias_method :breadcrumbs_collection, :breadcrumbs
module Utils
@@ -79,7 +81,7 @@ def add_breadcrumb(name, path = nil, filter_options = {})
module HelperMethods
def render_breadcrumbs(options = {}, &block)
- builder = (options.delete(:builder) || Breadcrumbs::SimpleBuilder).new(self, breadcrumbs, options)
+ builder = (options.delete(:builder) || Breadcrumbs::SimpleBuilder).new(self, breadcrumbs_collection, options)
content = builder.render.html_safe
if block_given?
capture(content, &block)
Something went wrong with that request. Please try again.