HAML Engine Render Scope
When rendering a template using the HAML engine and there are instance variables that should be used remember to set the scope on render. The easiest is just to set it to self.
@something = "text"
template = File.read("path/to/template")
result = Haml::Engine.new(template).render(self)
Written by Brian Miller
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Haml
Authors
Related Tags
#haml
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#