Class: JqueryTmplRails::JqueryTemplate

Inherits:
Tilt::Template
  • Object
show all
Includes:
ActionView::Helpers::JavaScriptHelper
Defined in:
lib/jquery-tmpl-rails/jquery_template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_mime_typeObject



10
11
12
# File 'lib/jquery-tmpl-rails/jquery_template.rb', line 10

def self.default_mime_type
  'application/javascript'
end

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



18
19
20
# File 'lib/jquery-tmpl-rails/jquery_template.rb', line 18

def evaluate(scope, locals, &block)
  %{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end

#prepareObject



14
15
16
# File 'lib/jquery-tmpl-rails/jquery_template.rb', line 14

def prepare
  @prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end