Module: AmberComponent::TemplateHandler
- Defined in:
- lib/amber_component/template_handler.rb,
lib/amber_component/template_handler/erb.rb
Overview
Provides code which handles rendering different template languages.
Defined Under Namespace
Classes: ERB
Class Method Summary collapse
Class Method Details
.render_from_string(context, content, type, block = nil) ⇒ String
13 14 15 16 17 18 19 20 21 |
# File 'lib/amber_component/template_handler.rb', line 13 def render_from_string(context, content, type, block = nil) = if type.to_sym == :erb { engine_class: ERB } else {} end ::Tilt[type].new() { content }.render(context, &block) end |