-
-
Save bmizerany/50164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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