5910 Breckenridge Pkwy Suite B, Tampa, FL. 33610
(800) 272-0707

SkillSoft Explore Course

IT Professional Curricula     Web Design Solution Area     Web Application Frameworks     Creating Web Applications with Sinatra
At the core of Sinatra is the ability to respond to routes. This course includes how to install and use Sinatra with the Thin server. It shows various aspects of route configuration, and covers the use of templates, views, and models, including ActiveRecord and DataMapper. It covers attachments and content streaming, as well as the basics of extensions and helpers, and dynamic modification of block binding. Finally, you'll learn about various aspects of application configuration to support features such as sessions, cookies, caching, and error handling.

Objectives

Getting Started

  • start the course
  • define Sinatra and describe its characteristics
  • describe how to install Sinatra and the Thin server on UNIX based platforms, and create and run a simple application

Routing and Non-Routed Content

  • declare routes using various route verbs in Sinatra
  • configure routes to share the same handler, use parameters, including query string parameters and wildcards
  • describe how the first match is used and how routes can be matched using regular expressions in Sinatra
  • halt, pass, trigger, and redirect requests in Sinatra
  • use filters to modify requests and responses in Sinatra
  • deliver static content from default public folder and other locations without using routing

Templates and Views

  • define inline and external templates to work with views in Sinatra
  • use instance variables to pass data to views, and use filters in Sinatra

Models

  • generate and use ActiveRecord models in a Sinatra application
  • generate and use DataMapper models in a Sinatra application

Working with Content and Error Handling

  • configure Sinatra to send attachments to a client
  • configure content streaming including finite streaming in a Sinatra application
  • configure finite streaming in a Sinatra application
  • use the not_found and error blocks to handle errors in Sinatra
  • describe application/class scope, request/instance scope, delegation scope, and associated bindings in Sinatra applications

Extensions and Helpers

  • create extensions in Sinatra
  • create and use helper methods in modules in Sinatra

Configuration, Settings and Caching

  • use the configure block to apply configuration in Sinatra
  • use set: or enable:key or the settings object to apply settings at class or top level in Sinatra
  • use the headers method in Sinatra to set HTTP headers in response objects to provide information to servers and clients
  • access information via the request object in Sinatra
  • set cache headers, cache control, and content expiration in Sinatra with the headers, cache_control, and expires helpers
  • define and generate ETags (entity tags) including weak ETags
  • enable and destroy sessions using the configure block and session.clear in Sinatra
  • set cookies in Sinatra
  • manage Sinatra dependencies with Bundler

Practice: Creating Sinatra Applications

  • develop and configure a basic application in Sinatra