Module: Loaf::ControllerExtensions::ClassMethods
- Defined in:
- lib/loaf/controller_extensions.rb
Instance Method Summary collapse
-
#breadcrumb(name, url, options = {}) ⇒ Object
(also: #add_breadcrumb)
Add breacrumb to the trail in controller as class method.
Instance Method Details
#breadcrumb(name, url, options = {}) ⇒ Object Also known as:
Add breacrumb to the trail in controller as class method
22 23 24 25 26 27 28 29 |
# File 'lib/loaf/controller_extensions.rb', line 22 def (name, url, = {}) normalizer = method(:_normalize_name) send(_filter_name, ) do |instance| normalized_name = normalizer.call(name, instance) normalized_url = normalizer.call(url, instance) instance.send(:breadcrumb, normalized_name, normalized_url, ) end end |