Learning Sinatra

Design and deploy your own web application in minutes using Sinatra

Learning Sinatra

Sudeep Agarwal, Manoj Sehrawat

1 customer reviews
Design and deploy your own web application in minutes using Sinatra
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.80
RRP $23.99
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.80
$44.99
$29.99p/m after trial
RRP $23.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781849519304
Paperback164 pages

Book Description

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.

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.

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.

Table of Contents

Chapter 1: Introduction to Sinatra
What is MVC?
Installing Sinatra
Writing your first Sinatra application
Where is the MVC in this code?
How to achieve MVC using Sinatra
Sinatra application layout
HAML
Installing HAML
Using HAML in a Sinatra application
What did the code do?
To Sinatra or not to Sinatra?
Other frameworks
Summary
Chapter 2: Introduction to Ruby
Installation
IRB
Ruby data types
Code blocks
Classes and objects
Control structures in Ruby
Loops
Controlling the flow of iterations
Exception handling
Summary
Chapter 3: Hello World
Getting started
The application
The code
Starting the application
Features
Object Relationship Mapper
Designing views
Summary
Chapter 4: Modeling the Backend
What is Object-relational mapping
When to use an ORM
How to define migrations
How to define models
How to run migrations
What are the responsibilites of the models?
Summary
Chapter 5: Handling HTTP Requests
Understanding the application file – app.rb
Writing routes for the responsibilities of the application
Sending the data and designing the views
Understanding before and after blocks
Summary
Chapter 6: Designing the Frontend Layout
Understanding Twitter Bootstrap and jQuery
Writing haml templates
Writing layout.haml
Writing signup.haml
Summary
Chapter 7: Handling User Data
Creating forms
Summary
Chapter 8: Connecting to a Database
Connecting to a database
Summary
Chapter 9: Authentication and Authorization
Using sessions in Sinatra
Handling authentication using session
Summary
Chapter 10: Deploying the App
Deployment
What is Heroku?
Using SQL on Heroku
Summary

What You Will Learn

  • Install and set up Ruby and Sinatra
  • Work with layouts and template routes
  • Extend the code to include CSS in different ways
  • Create projects and understand MVC
  • Design the front-end with Twitter Bootstrap
  • Use the MySQL/SQLite gem to communicate with databases
  • Implement sessions that can be used across multiple pages
  • Utilize the innovative and user-friendly features of ORMs

Authors

Table of Contents

Chapter 1: Introduction to Sinatra
What is MVC?
Installing Sinatra
Writing your first Sinatra application
Where is the MVC in this code?
How to achieve MVC using Sinatra
Sinatra application layout
HAML
Installing HAML
Using HAML in a Sinatra application
What did the code do?
To Sinatra or not to Sinatra?
Other frameworks
Summary
Chapter 2: Introduction to Ruby
Installation
IRB
Ruby data types
Code blocks
Classes and objects
Control structures in Ruby
Loops
Controlling the flow of iterations
Exception handling
Summary
Chapter 3: Hello World
Getting started
The application
The code
Starting the application
Features
Object Relationship Mapper
Designing views
Summary
Chapter 4: Modeling the Backend
What is Object-relational mapping
When to use an ORM
How to define migrations
How to define models
How to run migrations
What are the responsibilites of the models?
Summary
Chapter 5: Handling HTTP Requests
Understanding the application file – app.rb
Writing routes for the responsibilities of the application
Sending the data and designing the views
Understanding before and after blocks
Summary
Chapter 6: Designing the Frontend Layout
Understanding Twitter Bootstrap and jQuery
Writing haml templates
Writing layout.haml
Writing signup.haml
Summary
Chapter 7: Handling User Data
Creating forms
Summary
Chapter 8: Connecting to a Database
Connecting to a database
Summary
Chapter 9: Authentication and Authorization
Using sessions in Sinatra
Handling authentication using session
Summary
Chapter 10: Deploying the App
Deployment
What is Heroku?
Using SQL on Heroku
Summary

Book Details

ISBN 139781849519304
Paperback164 pages
Read More
From 1 reviews

Read More Reviews