Module: Crummy::ControllerMethods::InstanceMethods
- Defined in:
- lib/crummy/action_controller.rb
Instance Method Summary collapse
-
#add_crumb(name, url = nil, options = {}) ⇒ Object
Add a crumb to the crumbs array.
- #clear_crumbs ⇒ Object
-
#crumbs ⇒ Object
Lists the crumbs as an array.
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, ={}) crumbs.push [name, url, ] end |
#clear_crumbs ⇒ Object
63 64 65 |
# File 'lib/crummy/action_controller.rb', line 63 def clear_crumbs crumbs.clear end |
#crumbs ⇒ Object
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 |