Skip to content

Instantly share code, notes, and snippets.

@lucassmagal
Created July 5, 2012 20:13
Show Gist options
  • Save lucassmagal/3056172 to your computer and use it in GitHub Desktop.
Save lucassmagal/3056172 to your computer and use it in GitHub Desktop.
Sinatra app example
require 'sinatra'
require 'haml'
# run this app calling "ruby app.rb"
get '/' do
haml :index
end
get '/:name' do |n|
@name = n
haml :index
end
source :rubygems
gem 'sinatra'
gem 'haml'
# put this in /views
%h1= "Hello World #{@name}!"
# put this in /views
%html
%head
%title Hello World
%body
=yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment