Class: Executables::Web::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/executables/web/renderer.rb

Class Method Summary collapse

Class Method Details

.render(request, template, bindings) ⇒ Object



5
6
7
8
9
10
# File 'lib/executables/web/renderer.rb', line 5

def render(request, template, bindings)
  template_file = File.read(File.expand_path("#{File.dirname(__FILE__)}/../../../web/views/#{template}.erb"))
  layout_file = File.read(File.expand_path("#{File.dirname(__FILE__)}/../../../web/views/layout.erb"))
  sub_template_content = ERB.new(template_file).result(binding)
  content_with_layout = ERB.new(layout_file).result(binding)
end