Module: Waves::Renderers::Haml::ViewMethods

Defined in:
lib/waves/layers/renderers/haml.rb

Instance Method Summary collapse

Instance Method Details

#haml(string, assigns = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/waves/layers/renderers/haml.rb', line 20

def haml(string, assigns={})
  engine = ::Haml::Engine.new( string )
  scope = Scope.new
  helper = Waves.main::Helpers[self.class.basename]
  scope.meta_eval { include( helper ) }
  scope.instance_eval do
    assigns.each { |key,val| instance_variable_set("@#{key}",val) unless key == :request }
  end
  engine.render(scope, assigns)
end