Breadcrumb

Displays the path to the current resource using a hierarchy of links.

Anatomy

Breadcrumb do |b|
b.item do
b.link
end
b.separator
b.item do
b.page
end
end

API Reference

Breadcrumb

NameType
attributeskeyword arguments

Breadcrumb#item

NameType
attributeskeyword arguments

Rails link_to helper that renders a breadcrumb link.

NameTypeDefault
namestringnil
The link text to display.
optionsstring/hashnil
The URL or Rails route options.
html_optionshashnil
Additional HTML attributes for the link element.

Breadcrumb#separator

NameType
attributeskeyword arguments

Breadcrumb#page

NameType
attributeskeyword arguments

Breadcrumb#ellipsis

NameType
attributeskeyword arguments

Convenience method to build breadcrumb navigation from a collection of items automatically.

NameTypeDefault
required collectionarray
Array of hashes with { name: string, path: string } structure. The last item automatically becomes a page instead of a link, and separators are inserted between items.

Examples