Book Image

Learn Node.js by Building 6 Projects

By : Eduonix Learning Solutions
Book Image

Learn Node.js by Building 6 Projects

By: Eduonix Learning Solutions

Overview of this book

<p>With its event-driven architecture and efficient web services capabilities, more and more companies are building their entire infrastructure around Node.js. Node has become a de facto part of web development that any serious developer needs to master.</p> <p>This book includes six Node.js projects that gradually increase in complexity. You'll start by building a simple web server and create a basic website. You will then move to create the login system, blog system, chat system, and e-learning system.</p> <p>By creating and following the example projects in this book, you’ll improve your Node.js skills through practical working projects, and you'll learn how to use Node.js with many other useful technologies, such as ExpressJS, Kickstart, and Heroku.</p>
Table of Contents (12 chapters)

Class lessons – the last section


We're almost there! There's one last piece of functionality that we need and that is for lessons. We need to be able to add them and show them. I'm logged in the classes as an instructor:

The classes page for Brad

Now, I want to have a link beside View Lesson page that says Add Lesson.

Setting up the Add Lesson link in the Classes tab

We're going to go to the views | instructors | classes.handlebars file. In this file, I'm going to create another <th> in the <thead>, and then we want another td <tbody>, like this:

  <thead>
       <tr>
         <th>Class ID</th>
         <th>Class Name</th>
         <th></th>
         <th></th>
       </tr>
  </thead>
  <tbody>
       {{#each instructor.classes}}
       <tr>
          <td>{{class_id}}</td>
          <td>{{class_title}}</td>
          <td><a href="/classes/{{class_id}}/lessons"...