O'Reilly logo

Learning Sinatra by Manoj Sehrawat, Sudeep Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Connecting to a Database

In the previous chapter, we created a user interface for users to add their lists and items to the list through an HTML form. You learned about the basics of the form and its attributes, how to handle the data submitted by a user on the server side, and how to prevent the user from entering wrong data in the application through validations. Now that valid data has reached the server side, let's persist the data for the users so that we can show it back to the user whenever the user wants. To achieve this, we need to store it to the database, which you are going to learn step by step in this chapter.

In this chapter, we will discuss the following topics:

  • How to connect and communicate with a database
  • How to use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required