Chapter 3Collecting Records

In the last chapter, we built a fully functioning website. We covered external views, used the Slim templating engine, and created styles with Sass.

In this chapter, we’ll look at storing some of our data in a database. We will create a Song class and use it to populate a database of songs. We’ll learn how to create, read, update, and delete songs in the database, and then develop a web front end to accomplish this.


If we are going to build a dynamic website, we need a place to store the page information. A database is for keeping data organized. In a traditional relational database, the data is organized into rows that form tables. Each row represents an item in the database, and each column represents a ...

Get Jump Start Sinatra now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.