Skip to content

Instantly share code, notes, and snippets.

@tbuehlmann
Created February 28, 2011 15:01
Show Gist options
  • Select an option

  • Save tbuehlmann/847427 to your computer and use it in GitHub Desktop.

Select an option

Save tbuehlmann/847427 to your computer and use it in GitHub Desktop.
application.rb
HELLO <%= bar %>
require 'haml'
require 'sinatra/base'
class Application < Sinatra::Base
configure do
enable :static
set :views, File.join(File.dirname(__FILE__), 'views')
set :public, File.join(File.dirname(__FILE__), 'public')
end
get '/' do
haml :index
end
end
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'application'
run Application
%h1 Hello World!
- bar = "baz"
= erb :_foo, :locals => {:bar => bar}
!!!
%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
%head
%title Application
%link{:rel => 'stylesheet', :type => 'text/css', :href => 'css/style.css'}
%meta{:content => 'text/html; charset=utf-8', :'http-equiv' => 'Content-Type'}
%body
= yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment