Class: Megatron::BreadcrumbHelper::Breadcrumbs

Inherits:
BlockHelpers::Base
  • Object
show all
Defined in:
app/helpers/megatron/breadcrumb_helper.rb

Instance Method Summary collapse

Instance Method Details

#crumb(text, href = nil, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/helpers/megatron/breadcrumb_helper.rb', line 4

def crumb(text, href = nil, options={})
  options[:class] = add_class(options[:class], 'breadcrumb')

  if href.nil?
    (:span, options) { text.to_s }
  else
    link_to(href, options){ text.to_s }
  end
end

#display(body) ⇒ Object



14
15
16
# File 'app/helpers/megatron/breadcrumb_helper.rb', line 14

def display(body)
  (:nav, class: 'breadcrumbs') { body }
end