Instant Sinatra Starter [Instant]


This title is available as an eBook only
Instant Sinatra Starter [Instant]
eBook: $12.99
Formats: PDF, PacktLib, ePub and Mobi formats
$11.04
save 15%!
Print & eBook also available on:
Learn in an Instant - Short, Fast, Focused
Overview
Table of Contents
Author
Support
Sample Chapters
  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Set up a Sinatra project
  • Deploy your project to the Web
  • Learn about the advanced features of Sinatra

Book Details

Language : English
eBook : 70 pages
Release Date : June 2013
ISBN : 1782168214
ISBN 13 : 9781782168218
Author(s) : Joe Yates
Topics and Technologies : All Books, Instant, Web Development, Open Source, Web Development

Table of Contents

Sinatra Starter
  • Sinatra Starter
    • So, what is Sinatra?
      • What is a web framework?
      • Sinatra or Ruby on Rails?
      • Who's using it?
      • Minimalistic
      • Education
      • Performance
      • Prototyping
      • Source code
    • Installation
      • Step 1 – what do I need?
      • Step 2 – installing library dependencies
        • Installing a C compiler
        • Installing external packages
      • Step 3 – installing Ruby
        • Installing a Ruby Version Manager
        • Installing Ruby
      • Step 4 – installing Bundler
      • Step 5 – installing Git
      • Step 6 – registering for online accounts
        • Code
        • Application deployment
      • And that's it!!
    • Quick start – your first Sinatra application
      • Step 1 – creating the application
        • Logging
      • Step 2 – putting the application under version control with Git
      • Step 3 – deploying the application
      • Step 4 – page layout with Slim
      • Step 5 – styling
      • Step 6 – development setup
      • Step 7 – testing the application
    • Top 18 features you need to know about
      • Sinatra application types
        • Classic applications
        • Modular style applications
      • Runtime environments
      • Project layout
        • Static files
        • Templates
      • Middleware
      • Sessions
        • Session security
      • GET requests
      • Handling forms
        • Uploading files
        • Protecting your application
        • CSRF
      • Handlers, routes, and parameters
        • Handlers
        • Routes
        • Parameters
        • The params variable
        • block parameters
        • Query parameters
        • Wildcard or splat parameters
        • Optional parameters
        • Regular expressions
        • Route conditions
      • Templating
        • Inline templates
        • HTML templates
        • Slim
      • Layouts
      • Sending e-mail
      • Logging
        • How to write logs to a file
      • Request
      • Response
        • Status
      • Using a database
        • Setup
        • Create a database
        • Insert an address
      • The Sinatra DSL
      • Helpers
      • Settings
    • People and places you should get to know
      • Official sites
      • Articles and tutorials
      • Community
      • Blogs
      • Twitter
      • About Packt Publishing
      • Writing for Packt

Joe Yates

Joe Yates is a programmer with 15 years of experience in software development on the desktop and Web platforms, and develops software for areas ranging right from business to culture to research. While his main focus is on projects based on Ruby (in Sinatra and Ruby on Rails), he mixes in other languages (such as Python, JavaScript/Node.js, and Clojure) when appropriate and is developing an interest in the area of DevOps using Chef.

He is based in Italy and works as a consultant. He also develops projects for various companies across Europe.

Sorry, we don't have any reviews for this title yet.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 1 submitted: last submission 16 Aug 2013

Errata type: Others | Page number: 47

On page 47, the mentioned definition for "add_charset" is wrong. The correct one is as follows:

add_charset: This specifies a list of response content types (for example, 'application/json'). When preparing a response, if Sinatra finds that the type of response is one of the types in the list, it adds a character set indicator to the Content-Type header. Note, that normally, you should replace the existing list, but it is better to add to it, for example, settings.add_charset << "some/type".

Sorry, there are currently no downloads available for this title.

Frequently bought together

Instant Sinatra Starter [Instant] +    HTML5 Boilerplate Web Development =
50% Off
the second eBook
Price for both: $19.25

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Set up a development environment for Sinatra
  • Set up a Sinatra project
  • Create a Git repository for a Sinatra project
  • Create HTML templates with Slim
  • Deploy a Sinatra project to Heroku
  • Handle requests for different formats (HTML and JSON)
  • Receive file uploads and store them
  • Keep your application secure from common attacks

In Detail

Sinatra is a free and open source software web application library and domain-specific language written in Ruby. It provides both the beginner and the experienced professional with a tool for creating simple, yet powerful web applications.

Instant Sinatra Starter is a practical, hands-on guide that provides you with the necessary knowledge to get started from scratch.Including all the necessary steps to put together a Sinatra application and get it online, we will also learn all that you need to know to make your application all it can and should be.

We'll learn how a web request is received, pre-processed by Rack and Sinatra middleware, then handed to the application. Learn how to build a response via templates, then hand the response back to be sent to the client.L

Later we will learn to configure your application for your specific needs and handle more complex requests and responses. With Instant Sinatra Starter, we’ll explore the essentials to get our first Sinatra application online.

Approach

Get to grips with a new technology, understand what it is and what it can do for you, and then get to work with the most important features and tasks. Written as a practical guide, Instant Sinatra Starter will help you create a simple web app in no time at all.

Who this book is for

Instant Sinatra Starter is great if you are looking to get started with Sinatra for web development. Some previous experience with Ruby would be beneficial though not necessary for this step-by-step exploration of Sinatra and the world of web development.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software