Book Image

Learning Sinatra

By : Sudeep Agarwal, Manoj Sehrawat
Book Image

Learning Sinatra

By: Sudeep Agarwal, Manoj Sehrawat

Overview of this book

<p>Sinatra is a Ruby framework that is widely used in the Industry. You can use it to make a single-page web app or a large-scale one. With the increased online footprint, you can create and deploy your own application.</p> <p>Whether you are brand-new to online learning or a seasoned expert, this book will provide you with the skills you need to successfully create, customize, and deploy a Sinatra application. Starting from the beginning, this book will cover how to install Ruby and Sinatra, construct the back-end, design and customize the front-end layout, and utilize the innovative and user-friendly features of ORMs. By sequentially working through the steps in each chapter, you will quickly master Sinatra's features to create your own application.</p> <p>With ample screenshots and code that offers a play-by-play account of how to build an application, Learning Sinatra will ensure your success with this cutting-edge framework.</p>
Table of Contents (17 chapters)
Learning Sinatra
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

The application


To understand how to write a Sinatra application, we will take up a small project and discuss every part in detail, in this and the following chapters.

The idea

We shall make a ToDo app and use Sinatra and a lot of other libraries. The features of the app will be as follows:

  • Each user can have multiple todo lists

  • Each todo list will have multiple items

  • Todo lists can be private, public, or shared with a group

  • Items in each todo list can be assigned to a user or group

The modules that we will build are as follows:

  • Users: This will manage users and groups

  • List: This will manage the todo lists

  • Items: This will manage the items for all the todo lists

Before we start writing the code, let's see what the file structure will be like, understand why each one of them is required, and learn about some new files.

The file structure

It is always good to keep certain files in certain folders for better readability. We can dump all the files in the home folder but that will make it difficult for...