Created
December 3, 2012 12:00
-
-
Save milafrerichs/4194540 to your computer and use it in GitHub Desktop.
Sample Rack App with Haml Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
old but gold