Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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.
Treehouse Videos
Jade (Pug) resources
Pug Code for HTML Form
register.pug
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', placeholder='name@email.com' 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
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up