Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Forked from tannerburson/sample.rb
Created January 21, 2009 20:17
Show Gist options
  • Save bmizerany/50164 to your computer and use it in GitHub Desktop.
Save bmizerany/50164 to your computer and use it in GitHub Desktop.
# Require sinatra/base instead of sinatra to avoid some of the magic
require 'sinatra/base'
module Sample
class Main < Sinatra::Base
# Pretty normal application here
get '/' do
erb :index
end
end
class Blog < Sinatra::Base
# We define it this way to not require a hard / at the end of the url
get '' do
erb :blog
end
get '/list' do
erb :blog_list
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment