This course will be retired on July 21, 2017.
Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Views and Routes Challenge Solution1:36 with Guil Hernandez
This video covers the solution to the " Views and Routes" challenge.
So how'd it go?
Were you able to create the ad trails and contact views and
write the routes for them?
Even if you created some part, that's still great.
So now I'm going to show you what I did.
So back in my project files.
I created the two views and
routes the same exact way I created the about view in route earlier.
Inside the templates folder, I created a new file named add-trails.html and
in the front matter block I set the name variable to add-trails, and
the URL value to /add-trails.
And then I simply created a heading with the content Add Trails.
So next I created another template and named it contact.html.
And I did the same thing here, so the name variable is set to contact, and
the URL set to /contact, and h1 reads Contact Trekker.
And in that index.html file, in the menu bar here,
I added the same directives I added to the home and about links earlier.
So for my Add Trails link, I set the ui-sref value to add-trails and
I set the contact links value to contact, and
then I added the ui-sref active directives inside the opening li tags.
So when I take a look at my app in the browser,
now each menu bar loads its corresponding view.
So keep up the good work and I'll see you in the next video.
You need to sign up for Treehouse in order to download course files.Sign up