Skip to content

Instantly share code, notes, and snippets.

@milafrerichs
Created December 3, 2012 12:00
Show Gist options
  • Save milafrerichs/4194540 to your computer and use it in GitHub Desktop.
Save milafrerichs/4194540 to your computer and use it in GitHub Desktop.
Sample Rack App with Haml Templates
class HelloApp
def self.call(env)
require 'haml'
@name = "Test"
template = File.read(File.join("views", "index.haml"))
haml_engine = Haml::Engine.new(template)
output = haml_engine.render(binding)
[200, {'Content-Type' => 'text/html'}, [output]]
end
end
Copy link

ghost commented Jan 21, 2020

old but gold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment