Skip to content

Instantly share code, notes, and snippets.

@mdeiters
Created May 12, 2009 16:18
Show Gist options
  • Save mdeiters/110565 to your computer and use it in GitHub Desktop.
Save mdeiters/110565 to your computer and use it in GitHub Desktop.
#TO RUN
# Install ruby
# from command line type gem install sinatra haml
# create this file and call it app.rb
# from command line type ruby app.rb
# open up browser to http://localhost:4567/haml
require 'rubygems'
require 'sinatra'
require 'haml'
get '/haml' do
@variable = "I can access this from haml"
haml :presentation #This treats everything under @@presentation in this file as a HAML file
end
__END__
@@presentation
%html
%head Testing Haml
%body
%h1 HI
%p
here is some text
.example= @variable
#some_div here is a div where i set the id
%p
more info at
%a{:href => 'http://haml.hamptoncatlin.com/'} Haml Webpage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment