module HQMF2JS::Generator
Public Class Methods
render_template(name, params)
click to toggle source
# File lib/generator/js.rb, line 4 def self.render_template(name, params) template_path = File.expand_path(File.join('..', "#{name}.js.erb"), __FILE__) template_str = File.read(template_path) template = ERB.new(template_str, nil, '-', "_templ#{TemplateCounter.instance.new_id}") context = ErbContext.new(params) template.result(context.get_binding) end