Use the Pug templating engine to create an HTML form based on a layout template template, and including reusable navigation components. You'll also learn how to render templates and pass data to a template in a route.
Jade (Pug) resources
Pug Code for HTML Form
extends layout block content .main.container .row .col-md-6.col-md-offset-3 h1.display-4.m-b-2 Sign Up // register form form(method='POST' action='/register') div.form-group label(for='name') Name: input#name.form-control(type='text', placeholder='first and last' name='name') div.form-group label(for='email') Email: input#email.form-control(type='email', firstname.lastname@example.org' name='email') div.form-group label(for='favoriteBook') Favorite Book: input#favoriteBook.form-control(type='text', placeholder='title of book' name='favoriteBook') div.form-group label(for='pw') Password: input#pw.form-control(type='password' name='password') div.form-group label(for='pw2') Confirm Password: input#pw2.form-control(type='password' name='confirmPassword') button.btn.btn-primary(type='submit') Sign up
You need to sign up for Treehouse in order to download course files.Sign up