Closed x-ror closed 6 years ago
The default breadcrumbs in Trestle have this format:
Root Breadcrumb(s) / Current Admin / Current Action
If you wish to globally change the Root Breadcrumbs, you can edit your config/initializers/trestle.rb
and add:
config.root_breadcrumbs = -> {
[Trestle::Breadcrumb.new("label", "/path"), Trestle::Breadcrumb.new("label", "/path"), ...]
}
Within an admin, you can customize the Current Admin breadcrumb using:
Trestle.resource(...) do
breadcrumb "label", "/path"
end
where the path parameter is optional.
If you want further control of the breadcrumbs within an admin, you can override the breadcrumbs
method:
Trestle.resource(...) do
admin do
def breadcrumbs
Trestle::Breadcrumb::Trail.new([
Trestle::Breadcrumb.new("Label", "/path1"),
Trestle::Breadcrumb.new("Label", "/path2")
])
end
end
end
To override the Custom Action breadcrumb, you will need to customize the show.html.erb
template for your admin. Within the template, you can add calls to the breadcrumb(label, path)
helper to append additional breadcrumbs.
I want add new hierarchy. Now it looks like this But i want what's been like here. How can I do this?