`lib/active_admin/dsl.rb`
# Rewrite breadcrumb links.
# Block will be executed inside controller.
# Block must return an array if you want to rewrite breadcrumb links.
#
# Example:
# ActiveAdmin.register Post do
# breadcrumb do
# [
# link_to('my piece', '/my/link/to/piece')
# ]
# end
# end
#
def breadcrumb(&block)
config.breadcrumb = block
end
### app/admin/companies.rb
ActiveAdmin.register Post do
breadcrumb do
links = [link_to('Admin', admin_root_path), link_to('Companies', admin_companies_path)]
if %(show edit).include?(params['action'])
links << link_to(company.name, admin_company_path)
end
links
end
end