Sha256: 927660ed9241d654c4f480f7b1cdae5260b128c94e3d1492cc0695daa5461401

Contents?: true

Size: 415 Bytes

Versions: 5

Compression:

Stored size: 415 Bytes

Contents

module AppFrame::BreadcrumbHelper 
  
  def breadcrumb(items = [])
    
    yield items if block_given?
    
    return unless items.any?
    
    last = items.pop
    
    result = items.map { |i| content_tag(:li, i + content_tag(:span, "/", :class => 'divider')) }
    result << content_tag(:li, last, :class => 'active')
    
    content_tag :ul, result.join().html_safe, :class => 'breadcrumb'
    
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_frame-0.6.1 app/helpers/app_frame/breadcrumb_helper.rb
app_frame-0.5.8 app/helpers/app_frame/breadcrumb_helper.rb
app_frame-0.5.7 app/helpers/app_frame/breadcrumb_helper.rb
app_frame-0.5.6 app/helpers/app_frame/breadcrumb_helper.rb
app_frame-0.5.5 app/helpers/app_frame/breadcrumb_helper.rb