Class: Waves::Renderers::Erubis
- Includes:
- Mixin
- Defined in:
- lib/renderers/erubis.rb
Class Method Summary collapse
Methods included from Mixin
Class Method Details
.render(path, assigns) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/renderers/erubis.rb', line 44 def self.render( path, assigns ) eruby = ::Erubis::Eruby.new( template( path ) ) helper = helper( path ) context = ::Erubis::Context.new context. { include( helper ) ; } context.instance_eval do assigns.each do |key,val| instance_variable_set("@#{key}",val) end end context.render(eruby) end |