Class: Megatron::BreadcrumbHelper::Breadcrumbs
- Defined in:
- app/helpers/megatron/breadcrumb_helper.rb
Instance Method Summary collapse
Methods inherited from Helper
Instance Method Details
#crumb(text = nil, href = nil, options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/megatron/breadcrumb_helper.rb', line 4 def crumb(text = nil, href = nil, ={}, &block) [:class] = add_class([:class], 'breadcrumb') if block if href.nil? content_tag :span, , &block else link_to href, , &block end else if href.nil? content_tag(:span, ) { text.to_s } else link_to(href, ) { text.to_s } end end end |
#display(body) ⇒ Object
22 23 24 |
# File 'app/helpers/megatron/breadcrumb_helper.rb', line 22 def display(body) content_tag(:nav, class: 'breadcrumbs') { body } end |