Skip to content

Instantly share code, notes, and snippets.

@mustafah
Created May 19, 2015 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafah/b2fba950916457339505 to your computer and use it in GitHub Desktop.
Save mustafah/b2fba950916457339505 to your computer and use it in GitHub Desktop.
Haml::Helpers render
module Haml::Helpers
def render(filename)
path = File.join(File.dirname(caller[0].split(":")[0]), "_#{filename}.haml")
Haml::Engine.new(File.read(path)).render
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment