Module: Loaf::ControllerExtensions::InstanceMethods

Defined in:
lib/loaf/controller_extensions.rb

Overview

ClassMethods

Instance Method Summary collapse

Instance Method Details

#_breadcrumbsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Collection of breadcrumbs



77
78
79
# File 'lib/loaf/controller_extensions.rb', line 77

def _breadcrumbs
  @_breadcrumbs ||= []
end

Add breadcrumb in controller as instance method

Parameters:

  • name (String)
  • url (Object)


69
70
71
# File 'lib/loaf/controller_extensions.rb', line 69

def breadcrumb(name, url, options = {})
  _breadcrumbs << Loaf::Crumb.new(name, url, options)
end

#clear_breadcrumbsObject

Remove all current breadcrumbs



84
85
86
# File 'lib/loaf/controller_extensions.rb', line 84

def clear_breadcrumbs
  _breadcrumbs.clear
end