All right so now it's time for challenge 4. And what I want you to do 1
inside Atom is that is I want you to create a new folder inside the views folder. 2
So click on view and hold down Shift + A and you should be able to create a new folder that we're going 3
to call partials. 4
And inside this folder we're going to drag our header and footer.ejs files. 5
So we're going to put it inside here. 6
So now we have our main web pages and then we have our partials 7
so partially complete HTML files inside a folder called partials. Now out there in the wild 8
when you come across Node Express EJS apps, this is usually the structure that you will see. But because 9
it's no longer inside the views folder, our current code where we're at including a header and footer will 10
now stop working. 11
So if I go to my web page I hit refresh, we're going to get some errors. And it's telling us that it could 12
not find the include file which is called header and it points to the line where there's a error. 13
To complete this challenge try and fix your code so that your header and footer partials still get 14
applied and we get the same result as we saw previously with our nav bar and with our footer. 15
Pause the video now and see if you can fix the code. 16
All right so this is my first hint for you. 17
The string that we put inside here that's called header 18
used to work. 19
And it was because this file could header.ejs was directly inside our views folder. 20
And this is the place where EJS will look to try and render any of these files or partials. 21
So now that this header file has moved into a subfolder called partials, 22
can you fix this part of the code so that it works again and we stop getting errors when we try to load 23
up our web page?