Module: Opal::ERB
- Defined in:
- opal/lib/opal/erb.rb
Defined Under Namespace
Classes: Compiler
Class Method Summary collapse
-
.compile(source, file_name = '(erb)') ⇒ String
Compile ERB code into javascript.
Class Method Details
.compile(source, file_name = '(erb)') ⇒ String
Compile ERB code into javascript.
[Opal::ERB] can be used to compile [ERB] templates into javascript code. This module uses the [Opal::Compiler] internally.
Compiled templates, when run in a javascript environment, will appear
under the Template
namespace, and can be accessed as:
Template['template_name'] # => template instance
26 27 28 |
# File 'opal/lib/opal/erb.rb', line 26 def self.compile(source, file_name = '(erb)') Compiler.new(source, file_name).compile end |