Chapter 3 Collecting 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.
Databases
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 ...
Get Jump Start Sinatra now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.