Created
April 1, 2014 23:01
-
-
Save mattallen/9924858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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