Sha256: 07a5583272924678216e30d0aa168598d71cf8fee75c595f62a028c1e6a4f3fa
Contents?: true
Size: 422 Bytes
Versions: 8
Compression:
Stored size: 422 Bytes
Contents
module Gratan module TemplateHelper def include_template(template_name, context = {}) tmplt = @context.templates[template_name.to_s] unless tmplt raise "Template `#{template_name}` is not defined" end context_orig = @context @context = @context.merge(context) instance_eval(&tmplt) @context = context_orig end def context @context end end end
Version data entries
8 entries across 8 versions & 1 rubygems