TrestleAdmin/trestle

View on GitHub
app/controllers/concerns/trestle/controller/breadcrumbs.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Trestle
  module Controller
    module Breadcrumbs
      extend ActiveSupport::Concern

      included do
        helper_method :breadcrumbs
        helper_method :breadcrumb
      end

    protected
      def breadcrumbs
        @_breadcrumbs ||= Breadcrumb::Trail.new(Trestle.config.root_breadcrumbs)
      end

      def breadcrumb(label, path=nil)
        breadcrumbs.append(label, path)
      end
    end
  end
end