Method: Baptize::Plugins::Helpers#render
- Defined in:
- lib/baptize/plugins/helpers.rb
#render(path, locals = {}) ⇒ Object
22 23 24 25 26 |
# File 'lib/baptize/plugins/helpers.rb', line 22 def render(path, locals = {}) require 'erb' require 'ostruct' ERB.new(File.read(path)).result(locals.kind_of?(Binding) ? locals : OpenStruct.new(locals).instance_eval { binding }) end |