Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Code, slides and notes from a talk given at pghrb on June 7, 2012

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 slides
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 config.ru
README.md

Intro to Sinatra

These are the resources of a talk I gave at pghrb June 7, 2012.

Prerequisites

Must have:

  • Ruby (this presentation uses v1.9.2)
  • Sinatra (v1.3.2)

Really really should have:

  • Git (version control)
  • Bundler (gem management)

Recommended to have soon:

Slides

The slides are in HTML in the slides/presentation.html file. The slides are licensed Creative Commons BY-NC-SA 3.0. (If you're curious, they're made from Eric Meyer's S5)

Examples in this repo

The examples in this order reuse concepts from the previous examples and add new concepts with each one.

  • examples/hello_world: Has one page that renders text. instructions.txt has the commands that I typed to get this up and running and what they do.
  • examples/route_patterns: An example of using pattern matching in a route and the resulting match param value in the output.
  • examples/templates: An example of rendering an erb template using a value from the route params.
  • examples/http_verbs: An example of having a GET route and a POST route doing different things and using a form for the POST route. Also uses a layout named index.erb.

The examples are licensed MIT.

Examples of Sinatra in action

Resources

Something went wrong with that request. Please try again.