Give it a path with character to split at and one to join the crumbs with.
It will generate a list of links that act as pointers to previous pages on
this path.
@example usage
breadcrumbs('/path/to/somewhere')
# results in this, newlines added for readability:
<a href="/path">path</a>/
<a href="/path/to">to</a>/
<a href="/path/to/somewhere">somewhere</a>
Optionally a href prefix can be specified which generate link names a
above, but with the prefix prepended to the href path.
@example usage
breadcrumbs('/path/to/somewhere', '/', '/', '/mycontroller/action')
# results in this, newlines added for readability:
<a href="/mycontroller/action/path">path</a>/
<a href="/mycontroller/action/path/to">to</a>/
<a href="/mycontroller/action/path/to/somewhere">somewhere</a>
@return [String]
46: def breadcrumbs(path, split = '/', join = '/', href_prefix = '')
47: atoms = path.split(split).reject{|a| a.empty?}
48: crumbs = atoms.inject([]){|s,v| s << [s.last,v]}
49: bread = crumbs.map do |a|
50: href_path = href_prefix + a*'/'
51: a(a[1], href_path)
52: end
53: bread.join(join)
54: end