Module: Proscenium::UI::Breadcrumbs::Control::ClassMethods
- Defined in:
- lib/proscenium/ui/breadcrumbs/control.rb
Instance Method Summary collapse
-
#add_breadcrumb(name, path = nil, **options) ⇒ Object
Appends a new breadcrumb element into the collection.
-
#prepend_breadcrumb(name, path = nil, **options) ⇒ Object
Prepend a new breadcrumb element into the collection.
Instance Method Details
#add_breadcrumb(name, path = nil, **options) ⇒ Object
Appends a new breadcrumb element into the collection.
25 26 27 28 29 30 31 32 |
# File 'lib/proscenium/ui/breadcrumbs/control.rb', line 25 def (name, path = nil, **) = .slice(:if, :unless, :only, :except) = .except(:if, :unless, :only, :except) before_action() do |controller| controller.send :add_breadcrumb, name, path, end end |
#prepend_breadcrumb(name, path = nil, **options) ⇒ Object
Prepend a new breadcrumb element into the collection.
43 44 45 46 47 48 49 50 |
# File 'lib/proscenium/ui/breadcrumbs/control.rb', line 43 def (name, path = nil, **) = .slice(:if, :unless, :only, :except) = .except(:if, :unless, :only, :except) before_action() do |controller| controller.send :prepend_breadcrumb, name, path, end end |