Instant Sinatra Starter [Instant]
|Print & eBook also available on:|
- 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 DetailsLanguage : 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 ContentsSinatra Starter
- Sinatra Starter
- So, what is Sinatra?
- What is a web framework?
- Sinatra or Ruby on Rails?
- Who's using it?
- Source code
- 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
- Application deployment
- And that's it!!
- Quick start – your first Sinatra application
- Step 1 – creating the application
- 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
- Session security
- GET requests
- Handling forms
- Uploading files
- Protecting your application
- Handlers, routes, and parameters
- The params variable
- block parameters
- Query parameters
- Wildcard or splat parameters
- Optional parameters
- Regular expressions
- Route conditions
- Inline templates
- HTML templates
- Sending e-mail
- How to write logs to a file
- Using a database
- Create a database
- Insert an address
- The Sinatra DSL
- People and places you should get to know
- Official sites
- Articles and tutorials
- About Packt Publishing
- Writing for Packt
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.
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
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.
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.