Code, slides and notes from a talk given at pghrb on June 7, 2012
JavaScript Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Intro to Sinatra

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


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:


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