Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pg 193 - Missing add 'details' to router? #503

Open
E-F-J opened this issue Jan 26, 2021 · 4 comments
Open

Pg 193 - Missing add 'details' to router? #503

E-F-J opened this issue Jan 26, 2021 · 4 comments

Comments

@E-F-J
Copy link

E-F-J commented Jan 26, 2021

Hi! I believe
this.route('details');
is missing from the router after we generate the route on page 193

@balinterdi balinterdi changed the title Missing add 'details' to router? Pg 193 - Missing add 'details' to router? Feb 4, 2021
@balinterdi
Copy link
Collaborator

The code amended by generators is usually not shown (such as it the case of the ember g route bands/new command on page 95, for example).

The reason being is that if the reader follows along with the book and runs the same generate command, they'll have the same, working app as in the book.

Do I misunderstand something?

@lljr
Copy link

lljr commented Feb 23, 2021

@balinterdi pg 197 (latest version of the book as of now) shows

1 // app/router.js
2 import EmberRouter from '@ember/routing/router';
3 import config from 'rarwe/config/environment';
4
5
export default class Router extends EmberRouter {
6 location = config.locationType;
7 rootURL = config.rootURL;
8
}
9
10
Router.map(function () {
- 11
this.route('bands', function () {
- 12
this.route('band', { path: ':id' }, function () {
+ 13
this.route('bands', { path: '/' }, function () {
+ 14
this.route('band', { path: 'bands/:id' }, function () {
15
this.route('songs');
16
});
- 17 this.route('new');
+ 18 this.route('new', { path: 'bands/new' });
19
20
});
});

it's missing this.route('details') after this.route('songs')

@balinterdi
Copy link
Collaborator

Thank you for clarifying this.

I took a look and we add the bands.band.details route later, on page 199:

rock-and-roll-with-ember-octane-20210211 pdf 2021-02-24 at 10 48 07 AM

So I think that's not a "bug" then.

@lljr
Copy link

lljr commented Mar 8, 2021

@balinterdi I think what we're trying to say is that, yes, the command is there to set up the route files. If you inspect router.js after typing the command you have screenshot, I think it does not setup this.route('details') inside the nested router functions.

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

No branches or pull requests

3 participants