Module: Crummy::ControllerMethods::InstanceMethods

Defined in:
lib/crummy/action_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_crumb(name, url = nil, options = {}) ⇒ Object

Add a crumb to the crumbs array.

add_crumb("Home", "/")
add_crumb("Business") { |instance| instance.business_path }


59
60
61
# File 'lib/crummy/action_controller.rb', line 59

def add_crumb(name, url=nil, options={})
  crumbs.push [name, url, options]
end

#clear_crumbsObject



63
64
65
# File 'lib/crummy/action_controller.rb', line 63

def clear_crumbs
  crumbs.clear
end

#crumbsObject

Lists the crumbs as an array



68
69
70
# File 'lib/crummy/action_controller.rb', line 68

def crumbs
  get_or_set_ivar "@_crumbs", []
end