Module: AmberComponent::TemplateHandler
- Defined in:
- lib/amber_component/template_handler.rb
Overview
Provides code which handles rendering different template languages outside of Rails.
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 22 |
# File 'lib/amber_component/template_handler.rb', line 13 def render_from_string(context, content, type, block = nil) tilt_handler = ::Tilt[type] raise UnknownViewTypeError, " Unknown view type for `\#{context.class}`!\n Check return value of param type in `view type: :[type]`\n or the view file extension.\n ERR\n\n tilt_handler.new { content }.render(context, &block).html_safe\nend\n".squish unless tilt_handler |