class LeafletHelper::U
Public Class Methods
pull_in(template_name, options={})
click to toggle source
insert HTML/JS or whatever from a file in the lib/templates directory use ERB to pre-process the file using local binding
# File lib/leaflet_helper/u.rb, line 10 def pull_in(template_name, options={}) options.each { |k,v| instance_variable_set("@#{k}", v) } puts "="*65 print "pull_in(#{template_name}) option keys: " puts options.keys.join(', ') puts "="*65 @file_name = LeafletHelper::TEMPLATES + template_name return ERB.new(@file_name.read, 0, '>').result(binding) end