Skip to content

Instantly share code, notes, and snippets.

View randland's full-sized avatar

Nick Karpenske randland

  • Doximity
  • Boulder, CO
View GitHub Profile
@randland
randland / application_helper.rb
Created June 22, 2010 15:51 — forked from mtodd/enumerable_with_context.rb
Breadcrumbs. Uses Route recognition and intelligent naming
module ApplicationHelper
def breadcrumb(url, options = {})
options.reverse_merge!( :separator => ' » ',
:home_link => 'Home')
path_segments = url.sub(/\?.*/,'').split('/')[1..-1]
return '' if path_segments.blank? # ie: suppress breadcrumbs on homepage