Node.js for Rails developers, Part 5 (Express Views)

This post is part of a series for Rails developers who want to get started with Node.js. After creating the application’s controllers, its time to create the views. After following along to the end of this post, the goal is to have a working navigable application.

NOTE: You’ll notice undesired repetition of code across index.ejs, show.ejs, new.ejs, and edit.ejs. The express-ejs-layouts module enables us to use a common application layout, but it conflicts with our custom bootstrap-styled flash messages, so in preference for app functionality over code DRY-ness, we will stick with these views for now.

Checkpoint

At this point, you should be able to click around the application without breaking anything, even though database functionality is still missing.

It’s time to enhance this application’s functionality by connecting a datastore. Choose your own adventure (6a or 6b):