Skip to content

Instantly share code, notes, and snippets.

@oren
Created March 20, 2011 19:10
Show Gist options
  • Select an option

  • Save oren/878569 to your computer and use it in GitHub Desktop.

Select an option

Save oren/878569 to your computer and use it in GitHub Desktop.
Sinatra project structure
app.rb # require sinatra, haml, vendor'd gems, models/init, routes/init, helpers/init
helpers/
init.rb # Requires each helper file
helper1.rb # Related helper methods
models/
init.rb # Require sequel, set up the DB; require each model, in controlled order
foo.rb # One or more Sequel models
bar.rb # One or more related models
routes/
init.rb # Require each route, in controlled order
admin.rb # One or more routes related to administration
foo.rb # One or more routes related to some feature
views/
layout.haml # Common layout
foo.haml # Specific view
bar.haml # Specific view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment