Skip to content

Instantly share code, notes, and snippets.

@mattallen
Created April 1, 2014 23:01
Show Gist options
  • Save mattallen/9924858 to your computer and use it in GitHub Desktop.
Save mattallen/9924858 to your computer and use it in GitHub Desktop.
module Gretel
class << self
include Resettable
# Returns the path from with breadcrumbs are loaded. Default is +config/breadcrumbs.rb+
# in the app and all loaded engines. Breadcrumbs set in the app will override
# breadcrumbs set in engines.
def breadcrumb_paths
@breadcrumb_paths ||= begin
engine_roots = Rails::Application::Railties.engines.map { |e| e.config.root }
[*engine_roots, Rails.root].map do |root|
[root.join("config", "breadcrumbs.rb"),
root.join("config", "breadcrumbs", "**", "*.rb"),
root.join("app", "views", "breadcrumbs", "**", "*.rb")]
end.flatten
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment