Class: LeafletHelper::U
- Inherits:
-
Object
- Object
- LeafletHelper::U
- Defined in:
- lib/leaflet_helper/u.rb
Class Method Summary collapse
-
.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.
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, ={}) .each { |k,v| instance_variable_set("@#{k}", v) } @file_name = LeafletHelper::TEMPLATES + template_name return ERB.new(@file_name.read, 0, '>').result(binding) end |