Skip to content

Instantly share code, notes, and snippets.

@ZucchiniZe
Created November 28, 2014 00:28
Show Gist options
  • Select an option

  • Save ZucchiniZe/584e9aabf847e0ecae98 to your computer and use it in GitHub Desktop.

Select an option

Save ZucchiniZe/584e9aabf847e0ecae98 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'haml'
require 'better_errors'
configure :development do
use BetterErrors::Middleware
BetterErrors.application_root = __dir__
end
get '/' do
@title = 'HAML Test'
haml :index
end
require './app'
run Sinatra::Application
source "https://rubygems.org"
group :development do
gem "better_errors"
gem "binding_of_caller"
gem "rerun"
end
gem "sinatra"
gem "haml"
%h1 Title: #{@title}
%p Hello HAML!
!!! 5
%html
%head
%meta{ charset: 'utf-8' }
%title= @title
%link{ rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' }
%link{ rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' }
%script{ src: '//code.jquery.com/jquery-2.1.1.min.js' }
:css
header { border-bottom: 1px solid #eee; }
main { margin-top: 25px; }
%body
.container
%header
%h1.text-muted= @title
%main
= yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment