Skip to content

Instantly share code, notes, and snippets.

@nanodeath
Created January 23, 2010 19:42
Show Gist options
  • Save nanodeath/284757 to your computer and use it in GitHub Desktop.
Save nanodeath/284757 to your computer and use it in GitHub Desktop.
/ In your /views directory -- it has to be called "layout".
!!!
%html
%head
%title Weather Station
%body
%h1 Following is the main template:
= yield
require 'rubygems'
require 'sinatra'
require 'haml'
get '/my_template' do
@weather = "sunny"
@temperature = 80
haml :weather
end
/ In the "views/" subdirectory again
%h2 Conditions
%p== It appears to be quite #{@weather}!
%h2 Temperature
%p= @temperature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment