Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

breadCrumb override is ignored on a root route #83

Closed
sergproua opened this issue Jul 10, 2016 · 5 comments
Closed

breadCrumb override is ignored on a root route #83

sergproua opened this issue Jul 10, 2016 · 5 comments
Labels

Comments

@sergproua
Copy link

Consider the following routes.

When navigating to http://localhost:4200/customers the breadcrumbs generated is

  1. Customers

However when navigating to http://localhost:4200/customers/1 the breadcrumbs generated is

  1. OverrideMe!
  2. Profile.

router.js

  this.route('customers', function () {
    this.route('profile', {path: '/:id'});
  });

routes/customers.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'OverrideMe!'
  },
});
@dguettler
Copy link
Collaborator

It looks like ember-crumbly is looking at the customers.index route for the override.
So if you define the override on customers.index it is correctly applied for both cases.

@mrkirchner
Copy link

Ran into the same issue i noticed that in:

bread-crumbs.js

`_guessRoutePath(routeNames, name, index) {
const routes = routeNames.slice(0, index + 1);

if (routes.length === 1) {
  let path = `${name}.index`;

  return (this._lookupRoute(path)) ? path : name;
}

return routes.join('.');

},`

Removing the .index on the path seemed to fix my issue but i do not know why it was there in the first place or if it is truly needed

jevanlingen added a commit to jevanlingen/ember-crumbly that referenced this issue Dec 16, 2016
Enhanced implementation of poteto#101 for problem poteto#83.
@knownasilya
Copy link
Contributor

Also seeing this, weird that it requires the index, when the index could have it's own crumb. This is most certainly a bug.

@dguettler
Copy link
Collaborator

Related #99 and #104

@dguettler
Copy link
Collaborator

See #104

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants