Module: Rufus::Sixjo::Erb

Included in:
Context
Defined in:
lib/rufus/sixjo.rb

Overview

ERB views

Defined Under Namespace

Classes: Local

Instance Method Summary collapse

Instance Method Details

#erb(template, options = {}) ⇒ Object



200
201
202
203
204
205
206
207
208
# File 'lib/rufus/sixjo.rb', line 200

def erb (template, options = {})

  content = File.read("views/#{template}.erb")

  l = options[:locals]
  l = Local.new(self, l || {}) unless l.is_a?(Local)

  ::ERB.new(content).result(l.get_binding)
end