class Sprockets::JstProcessor
mime_type: ‘application/javascript’
JstProcessor.new(namespace: ‘App.templates’),
environment.register_engine ‘.jst’,
Change the default namespace.
mime_type: ‘application/javascript’
JstProcessor,
environment.register_engine ‘.jst’,
To accept the default options
Name your template “users/show.jst.ejs”, “users/new.jst.eco”, etc.
Exports server side compiled templates to an object.
Public: .jst engine.
def self.call(*args)
def self.call(*args) new.call(*args) end
def self.default_namespace
def self.default_namespace 'this.JST' end
def call(input)
def call(input) data = input[:data].gsub(/$(.)/m, "\\1 ").strip key = input[:name] <<-JST ction() { #{@namespace} || (#{@namespace} = {}); #{@namespace}[#{key.inspect}] = #{data}; all(this); JST end
def initialize(options = {})
def initialize(options = {}) @namespace = options[:namespace] || self.class.default_namespace end