Class: LeafletHelper::U

Inherits:
Object
  • Object
show all
Defined in:
lib/leaflet_helper/u.rb

Class Method Summary collapse

Class Method Details

.pull_in(template_name, options = {}) ⇒ Object

insert HTML/JS or whatever from a file in the lib/templates directory use ERB to pre-process the file using local binding



10
11
12
13
14
# File 'lib/leaflet_helper/u.rb', line 10

def pull_in(template_name, options={})
  options.each { |k,v| instance_variable_set("@#{k}", v) }
  @file_name = LeafletHelper::TEMPLATES + template_name
  return ERB.new(@file_name.read, 0, '>').result(binding)
end