Skip to content

Instantly share code, notes, and snippets.

@kris
Created May 12, 2009 21:23
Show Gist options
  • Save kris/110740 to your computer and use it in GitHub Desktop.
Save kris/110740 to your computer and use it in GitHub Desktop.
# Simply run <%= breadcrumbs(separator, options) %>
def breadcrumbs(separator = ' &gt; ', options = {})
(crumbs, previous) = [], []
request.path.split('/').each do |part|
previous << part
crumbs << link_to(part, previous.join('/'), options)
end
crumbs.join(separator)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment